".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 'no active poll

show polls'; return true; } } //else $lastpoll = safe_query("SELECT * FROM ".PREFIX."poll WHERE aktiv='1' AND laufzeit>".time()." AND intern<=".isclanmember($userID)." ORDER BY pollID DESC LIMIT 0,1"); $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)."")); if($_COOKIE['poll'] == $ds[pollID] OR $anz) { echo''; for ($n=1; $n<=10; $n++) { if($ds[o.$n]) $options[]=$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]; echo''; $n=1; 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"); echo''; if ($picwidth) echo''; $n++; } $anzcomments = getanzcomments($ds[pollID], 'po'); $comments='['.$anzcomments.'] comments'; echo'
'.$ds[titel].'
'.$gesamtstimmen.' votes
'.$option.': '.$perc.'%

'.$comments.'

show polls
'; unset($options); } else { echo'
'.$ds[titel].'

'; for ($n=1; $n<=10; $n++) { if($ds[o.$n]) $options[]=$ds[o.$n]; } $n=1; foreach ($options as $option) { echo' '.$option.'
'; $n++; } echo'


show polls
'; } } else echo 'no active poll

show polls'; } vote($pollID); ?>