function vote($poll) { global $userID, $_language; $pagebg = PAGEBG; $border = BORDER; $bghead = BGHEAD; $bgcat = BGCAT; if ($poll) { $lastpoll = safe_query("SELECT * FROM " . PREFIX . "poll WHERE aktiv='1' AND laufzeit>" . time() . " AND intern<=" . isclanmember($userID) . " and pollID='" . $poll . "' LIMIT 0,1"); } else { $num = mysql_num_rows(safe_query("SELECT * FROM " . PREFIX . "poll WHERE aktiv='1' AND laufzeit>" . time() . " AND intern<=" . isclanmember($userID) . "")); if ($num) { $start = rand(0, $num - 1); $lastpoll = safe_query("SELECT * FROM " . PREFIX . "poll WHERE aktiv='1' AND laufzeit>" . time() . " AND intern<=" . isclanmember($userID) . " ORDER BY pollID DESC LIMIT " . $start . "," . ($start + 1) . ""); } else { echo $_language->module['no_active_poll'] . '<br /><br />• <a href="index.php?site=polls">' . $_language->module['show_polls'] . '</a>'; return true; } } $anz = mysql_num_rows($lastpoll); $ds = mysql_fetch_array($lastpoll); if ($anz) { $anz = mysql_num_rows(safe_query("SELECT pollID FROM `" . PREFIX . "poll` WHERE pollID='" . $ds['pollID'] . "' AND hosts LIKE '%" . $_SERVER['REMOTE_ADDR'] . "%' AND intern<=" . isclanmember($userID) . "")); $anz_user = false; if ($userID) { $user_ids = explode(";", $ds['userIDs']); if (in_array($userID, $user_ids)) { $anz_user = true; } } $cookie = false; if (isset($_COOKIE['poll']) && is_array($_COOKIE['poll'])) { $cookie = in_array($ds['pollID'], $_COOKIE['poll']); } if ($cookie or $anz or $anz_user) { if ($ds['intern'] == 1) { $isintern = '(' . $_language->module['intern'] . ')'; } else { $isintern = ''; } $title = $ds['titel']; for ($n = 1; $n <= 10; $n++) { if ($ds['o' . $n]) { $options[] = clearfromtags($ds['o' . $n]); } } $votes = safe_query("SELECT * FROM " . PREFIX . "poll_votes WHERE pollID='" . $ds['pollID'] . "'"); $dv = mysql_fetch_array($votes); $gesamtstimmen = $dv['o1'] + $dv['o2'] + $dv['o3'] + $dv['o4'] + $dv['o5'] + $dv['o6'] + $dv['o7'] + $dv['o8'] + $dv['o9'] + $dv['o10']; eval("\$poll_voted_head = \"" . gettemplate("poll_voted_head") . "\";"); echo $poll_voted_head; $n = 1; $bg = BG_2; foreach ($options as $option) { $stimmen = $dv['o' . $n]; if ($gesamtstimmen) { $perc = $stimmen / $gesamtstimmen * 10000; settype($perc, "integer"); $perc = $perc / 100; } else { $perc = 0; } $picwidth = $perc; settype($picwidth, "integer"); eval("\$poll_voted_content = \"" . gettemplate("poll_voted_content") . "\";"); echo $poll_voted_content; $n++; } $anzcomments = getanzcomments($ds['pollID'], 'po'); $comments = '<a href="index.php?site=polls&pollID=' . $ds['pollID'] . '">[' . $anzcomments . '] ' . $_language->module['comments'] . '</a>'; eval("\$poll_voted_foot = \"" . gettemplate("poll_voted_foot") . "\";"); echo $poll_voted_foot; unset($options); } else { if ($ds['intern'] == 1) { $isintern = '(' . $_language->module['intern'] . ')'; } else { $isintern = ''; } $title = $ds['titel']; eval("\$poll_head = \"" . gettemplate("poll_head") . "\";"); echo $poll_head; for ($n = 1; $n <= 10; $n++) { if ($ds['o' . $n]) { $options[] = $ds['o' . $n]; } } $n = 1; foreach ($options as $option) { $option = $option; eval("\$poll_content = \"" . gettemplate("poll_content") . "\";"); echo $poll_content; $n++; } $pollID = $ds['pollID']; eval("\$poll_foot = \"" . gettemplate("poll_foot") . "\";"); echo $poll_foot; } } else { echo $_language->module['no_active_poll'] . '<br /><br />• <a href="index.php?site=polls">' . $_language->module['show_polls'] . '</a>'; } }
echo $head; /********************** HAFTUNGSAUSSCHLUSS **********************/ /********************** BEI MEHR ALS EINER SEITE AUSGABE DER SEITENZAHLEN **********************/ if ($pages > 1) { echo $page_link; } $i = 1; while ($ar = mysql_fetch_array($ergebnis)) { if ($i % 2) { $bg1 = BG_1; $bg2 = BG_2; } else { $bg1 = BG_3; $bg2 = BG_4; } $com = getanzcomments($ar[vidID], "mo"); /********************** INHALT VOM VIDEOS-BEREICH **********************/ $cat = $_language->module['category']; $len = $_language->module['length']; $comm = $_language->module['comments']; $vis = $_language->module['visit']; $cli = $_language->module['clicks']; $mins = $_language->module['mins']; $prevt = $_language->module['preview']; eval("\$content = \"" . gettemplate("videos_liste") . "\";"); echo '<div class="video_inner">'; echo $content; echo '</div>'; $i++; } } else {
$related .= '• <a href="' . $ds [url4] . '">' . $ds [link4] . '</a> '; if (empty ( $related )) $related = "N/A"; if ($ds [comments]) { if ($ds [cwID]) { $anzcomments = getanzcomments ( $ds [cwID], 'cw' ); if ($anzcomments == "1") $comments = '<a href="index.php?site=clanwars_details&cwID=' . $ds [cwID] . '">[' . $anzcomments . '] Kommentar</a> <br>letzter ' . getlastcommentposter ( $ds [cwID], 'cw' ) . ', am ' . date ( "d.m.y, H:i", getlastcommentdate ( $ds [cwID], 'cw' ) ); elseif ($anzcomments > "1") $comments = '<a href="index.php?site=clanwars_details&cwID=' . $ds [cwID] . '">[' . $anzcomments . '] Kommentare</a> <br>letzter ' . getlastcommentposter ( $ds [cwID], 'cw' ) . ', am ' . date ( "d.m.y, H:i", getlastcommentdate ( $ds [cwID], 'cw' ) ); else $comments = '<a href="index.php?site=clanwars_details&cwID=' . $ds [cwID] . '">Keine Kommentare</a>'; } else { $anzcomments = getanzcomments ( $ds [newsID], 'ne' ); if ($anzcomments == "1") $comments = '<a href="index.php?site=news_comments&newsID=' . $ds [newsID] . '">[' . $anzcomments . '] Kommentar</a> <br>letzter ' . getlastcommentposter ( $ds [newsID], 'ne' ) . ', am ' . date ( "d.m.y, H:i", getlastcommentdate ( $ds [newsID], 'ne' ) ); elseif ($anzcomments > "1") $comments = '<a href="index.php?site=news_comments&newsID=' . $ds [newsID] . '">[' . $anzcomments . '] Kommentare</a> <br>letzter ' . getlastcommentposter ( $ds [newsID], 'ne' ) . ', am ' . date ( "d.m.y, H:i", getlastcommentdate ( $ds [newsID], 'ne' ) ); else $comments = '<a href="index.php?site=news_comments&newsID=' . $ds [newsID] . '">Keine Kommentare</a>'; } } else $comments = ''; if (isnewsadmin ( $userID )) $adminaction = '<a href="?site=news&action=edit&newsID=' . $ds [newsID] . '">Edit</a> <a href="?site=news&action=delete&id=' . $ds [newsID] . '">Delete</a>'; else $adminaction = '';
$anzcomments = getanzcomments($ds['cwID'], 'cw'); $replace = array('$anzcomments', '$url', '$lastposter', '$lastdate'); $vars = array($anzcomments, 'index.php?site=clanwars_details&cwID=' . $ds['cwID'], clearfromtags(getlastcommentposter($ds['cwID'], 'cw')), date('d.m.Y - H:i', getlastcommentdate($ds['cwID'], 'cw'))); switch ($anzcomments) { case 0: $comments = str_replace($replace, $vars, $_language->module['no_comment']); break; case 1: $comments = str_replace($replace, $vars, $_language->module['comment']); break; default: $comments = str_replace($replace, $vars, $_language->module['comments']); break; } } else { $anzcomments = getanzcomments($ds['newsID'], 'ne'); $replace = array('$anzcomments', '$url', '$lastposter', '$lastdate'); $vars = array($anzcomments, 'index.php?site=news_comments&newsID=' . $ds['newsID'], clearfromtags(html_entity_decode(getlastcommentposter($ds['newsID'], 'ne'))), date('d.m.Y - H:i', getlastcommentdate($ds['newsID'], 'ne'))); switch ($anzcomments) { case 0: $comments = str_replace($replace, $vars, '0'); break; case 1: $comments = str_replace($replace, $vars, '1'); break; default: $comments = str_replace($replace, $vars, '$anzcomments'); break; } } } else {
$stimmen = $dv['o' . $n]; if ($gesamtstimmen) { $perc = $stimmen / $gesamtstimmen * 10000; settype($perc, "integer"); $perc = $perc / 100; } else { $perc = 0; } $picwidth = $perc; settype($picwidth, "integer"); $pic = '<table width="104" cellspacing="1" cellpadding="1" bgcolor="' . BORDER . '"> <tr bgcolor="' . BG_2 . '"> <td style="background-image: url(images/icons/poll_bg.gif);"><img src="images/icons/poll.gif" width="' . $picwidth . '" height="5" alt="" /></td> </tr> </table>'; $anzcomments = getanzcomments($ds['pollID'], 'po'); if ($anzcomments) { $comments = '<a href="index.php?site=polls&pollID=' . $ds['pollID'] . '">[' . $anzcomments . '] ' . $_language->module['comments'] . '</a> ' . $_language->module['latest_by'] . ' ' . getlastcommentposter($ds['pollID'], 'po') . ' - ' . date("d.m.Y - H:i", getlastcommentdate($ds['pollID'], 'po')); } else { $comments = '<a href="index.php?site=polls&pollID=' . $ds['pollID'] . '">[0] ' . $_language->module['comments'] . '</a>'; } eval("\$polls_content = \"" . gettemplate("polls_content") . "\";"); echo $polls_content; $n++; } eval("\$polls_foot = \"" . gettemplate("polls_foot") . "\";"); echo $polls_foot; $i++; unset($options); } } else {