
12-14-2002, 11:32 AM
|
 |
|
|
Join Date: Jan 2002
Location: Maastricht, NL
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Update
Delete excisting Vote Site Code and replace with
Quote:
<table width="100%" border="0">
<tr>
<td align="center">
$DataBestand = "score.php";
$Hoeveel = 10;
$Afronden = 2;
/* <?php include("rating.php"); ?> */
$Stand = file($DataBestand);
$IPadressen = explode("|",trim($Stand[1]));
$Stemmen = explode("|",trim($Stand[2]));
if(isset($stem) && intval($stem) <= $Hoeveel && intval($stem) > 0 && !in_array($REMOTE_ADDR,$IPadressen)) {
$Stemmen[] = $stem;
$IPadressen[] = $REMOTE_ADDR;
$SchrijfBestand = fopen($DataBestand,"w");
fputs($SchrijfBestand,"<?php exit; ?>\n");
fputs($SchrijfBestand,implode("|",$IPadressen)."\n ");
fputs($SchrijfBestand,implode("|",$Stemmen));
fclose($SchrijfBestand);
$Stand = file($DataBestand);
$IPadressen = explode("|",trim($Stand[1]));
$Stemmen = explode("|",trim($Stand[2]));
}
echo("<form style='margin: 0px' method=post action=''>\n");
if(in_array($REMOTE_ADDR,$IPadressen)) {
echo("Average: ".round((array_sum($Stemmen)/(count($Stemmen)-1)),$Afronden));
}
else { for($i = 1; $i <= $Hoeveel; $i++) { echo("<input name=stem value='$i' type=radio onclick='this.form.submit()'> $i "); } }
echo("</form>");
</td>
</tr>
</table>
|
NOTICE: code has to be places IN TOP OF INDEX.PHP
|