Hier staat het nu: http://trainerew.nl/index.php?id=motm&sub=archive&poll=19
En dit is het stuk uit de pagina:
<?php
@include ("config.php");
$result = mysql_query ("SELECT pollid, title, starts, subdate FROM polls WHERE status='on' AND graph='yes' ORDER BY pollid DESC");
$numrows = mysql_num_rows ($result);
if (isset ($_REQUEST['poll'])) {
$poll = mysql_fetch_array (mysql_query ("SELECT pollid, title, voting, results, graph, resultsvotes FROM polls WHERE pollid='$_REQUEST[poll]' AND status='on' AND graph='yes'"));
$option = mysql_query ("SELECT options, votes, images, order_id FROM options WHERE pollid='$_REQUEST[poll]' ORDER BY order_id ASC");
$total = mysql_fetch_assoc (mysql_query ("SELECT SUM(votes) AS total FROM options WHERE pollid='$_REQUEST[poll]'"));
if (mysql_num_rows (mysql_query ("SELECT pollid FROM polls WHERE pollid='$_REQUEST[poll]'")) == 1) {
?>
<tr>
<td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr class="text">
<td height="25" colspan="3" align="center"><b><?= $poll['title']; ?></b></td>
</tr>
<?php
while ($optionrows = mysql_fetch_array ($option)) {
@$percent = round (($optionrows['votes'] / $total['total']) * 100);
if ($optionrows['images'] == 'random') {
if ($handle = opendir ($dir2)) {
while (false !== ($file = readdir ($handle))) {
if ($file != '.' && $file != '..') {
$files[] = $file;
}
}
shuffle ($files);
}
$rand = rand (0, (count ($files) - 1));
$optionrows['images'] = $files[$rand];
}
?>
<tr class="text">
<td width="4%"> </td>
<td width="96%" height="25"><?= $optionrows['options']; ?>
<br>
<img src="<?= $dir2; ?>/<?= $optionrows['images']; ?>" width="<?= ($percent * $width) + 10; ?>" height="<?= $height; ?>" alt="<?= $optionrows['options']; ?>"><td><?= $percent; ?>%</td>