| \n");
print(" " . $poll["question"] . " ");
$pollanswers = sql_query("SELECT selection FROM pollanswers WHERE pollid=" . $poll["id"] . " AND selection < 20") or sqlerr();
$tvotes = mysql_num_rows($pollanswers);
$vs = array(); // count for each option ([0]..[19])
$os = array(); // votes and options: array(array(123, "Option 1"), array(45, "Option 2"))
// Count votes
while ($pollanswer = mysql_fetch_row($pollanswers))
$vs[$pollanswer[0]] += 1;
reset($o);
for ($i = 0; $i < count($o); ++$i)
if ($o[$i])
$os[$i] = array($vs[$i], $o[$i]);
print("\n");
$i = 0;
while ($a = $os[$i])
{
if ($tvotes > 0)
$p = round($a[0] / $tvotes * 100);
else
$p = 0;
print("| " . $a[1] . " | " .
"  $p% | \n");
++$i;
}
print(" \n");
$tvotes = number_format($tvotes);
print("".$lang_log['text_votes']."$tvotes \n");
print(" |