gen($query)) { $pl = new poll; $row = $sql ->fetch(); $start_datestamp = $tp->toDate($row['poll_datestamp'], "long"); $end_datestamp = $tp->toDate($row['poll_end_datestamp'], "long"); $uparams = array('id' => $row['user_id'], 'name' => $row['user_name']); $link = e107::getUrl()->create('user/profile/view', $uparams); $userlink = "".$row['user_name'].""; $text = $pl->render_poll($row, 'forum', 'oldpolls',true); $text .= "
".LAN_POSTED_BY." ".$userlink."
".LAN_ACTIVE.": ".LAN_FROM." ".$start_datestamp." ".LAN_TO." ".$end_datestamp."
"; /* $count = 0; $barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png"); $barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png"); $bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png"); foreach($optionArray as $option) { $text .= " ".$tp -> toHTML($option, TRUE, 'TITLE')."  
".$percentage[$count]."% [".POL LAN_31.": ".$voteArray[$count]."] \n"; $count++; } */ $query = "SELECT c.*, u.* FROM #comments AS c LEFT JOIN #user AS u ON c.comment_author_id = u.user_id WHERE comment_item_id=".intval($row['poll_id'])." AND comment_type='4' ORDER BY comment_datestamp"; if ($comment_total = $sql->gen($query)) { $text .= "
"; while ($row2 = $sql->fetch()) { $text .= e107::getComment()->render_comment($row2, 'poll', 'comment'); } $text .= "
"; } // $text .= ""; $ns->tablerender(LAN_PLUGIN_POLL_NAME." #".$row['poll_id'], $text); echo "
"; } } // Render List of Polls. $query = "SELECT p.*, u.user_name FROM #polls AS p LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id WHERE p.poll_type=1 ORDER BY p.poll_datestamp DESC"; if(!$array = $sql->retrieve($query,true)) { $ns->tablerender(POLLAN_28, "
".LAN_NO_RECORDS_FOUND."
"); require_once(FOOTERF); exit; } $array = array_slice($array, 1); if(empty($array)) { $ns->tablerender(POLLAN_28, "
".LAN_NO_RECORDS_FOUND."
"); require_once(FOOTERF); exit; } $text = "\n"; foreach($array as $row) { $from = $tp->toDate($row['poll_datestamp'], "short"); $to = $tp->toDate($row['poll_end_datestamp'], "short"); $poll_title = $tp->toHtml($row['poll_title'], true, 'TITLE'); $uparams = array('id' => $row['poll_admin_id'], 'name' => $row['user_name']); $link = e107::getUrl()->create('user/profile/view', $uparams); $userlink = "".$row['user_name'].""; $text .= "\n"; } $text .= "
".LAN_TITLE." ".LAN_POSTED_BY." ".LAN_ACTIVE."
{$poll_title} ".$userlink." ".$from." ".LAN_TO." ".$to."
"; e107::getRender()->tablerender(POLLAN_28, $text); require_once(FOOTERF); ?>