db_Select_gen($query)) { $row = $sql -> db_Fetch(); extract($row); $optionArray = explode(chr(1), $poll_options); $optionArray = array_slice($optionArray, 0, -1); $voteArray = explode(chr(1), $poll_votes); $voteArray = array_slice($voteArray, 0, -1); $voteTotal = array_sum($voteArray); $percentage = array(); foreach($voteArray as $votes) { $percentage[] = round(($votes/$voteTotal) * 100, 2); } $start_datestamp = $gen->convert_date($poll_datestamp, "long"); $end_datestamp = $gen->convert_date($poll_end_datestamp, "long"); $text = ""; $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 .= "\n"; $count++; } $query = "SELECT c.*, u.* FROM #comments AS c LEFT JOIN #user AS u ON FLOOR(SUBSTR(c.comment_author,1,INSTR(c.comment_author,'.')-1))=u.user_id WHERE comment_item_id=".intval($poll_id)." AND comment_type=4 ORDER BY comment_datestamp"; if ($comment_total = $sql->db_Select_gen($query) !== FALSE) { $text .= ""; } $text .= "
".$tp -> toHTML($poll_title)."
".POLLAN_35." ".$user_name.".
".POLLAN_37." ".$start_datestamp." ".POLLAN_38." ".$end_datestamp.".
".POLLAN_26.": $voteTotal

".$tp -> toHTML($option)."  
".$percentage[$count]."% [".POLLAN_31.": ".$voteArray[$count]."]


"; while ($row = $sql->db_Fetch()) { $text .= $cobj->render_comment($row); } $text .= "
"; $ns->tablerender(POLL_ADLAN01." #".$poll_id, $text); } } $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(!$sql->db_Select_gen($query)) { $ns->tablerender(POLLAN_28, "
".POLLAN_33."
"); require_once(FOOTERF); exit; } $array = $sql -> db_getList(); $oldpollArray = array_slice($array, 1); if(!count($oldpollArray)) { $ns->tablerender(POLLAN_28, "
".POLLAN_33."
"); require_once(FOOTERF); exit; } $text = "\n"; foreach($oldpollArray as $oldpoll) { extract($oldpoll); $from = $gen->convert_date($poll_datestamp, "short"); $to = $gen->convert_date($poll_end_datestamp, "short"); $text .= "\n"; } $text .= "
".POLLAN_34." ".POLLAN_35." ".POLLAN_36."
$poll_title $user_name $from ".POLLAN_38." $to
"; $ns->tablerender(POLLAN_28, $text); require_once(FOOTERF); ?>