View Full Version : Vote my Site
This hack will add a little piece of PHP Script in your index.php file.
This is the only file to edit and only 1 change is needed.
The result will look like:
o1 o2 o3 o4 o5 o6 o7 o8 o9 o10
o = click point to vote
1 -> 10 are the votenumbers
**************************************************
Latest Version:
1.01
Updates:
***** Vote has been centered on top of page.
Chris M
12-14-2002, 11:03 AM
Sounds good:)
Satan
Yub, are bussy with design now
Graphics
12-14-2002, 11:28 AM
I've not installed it yet. But it seems like what I might be looking for. However, could you make it so that it works with images?
You'd have your vote my site. But then after you'd voted it would show you a big number 9 image or summin like that. Not sure if this is already implemented. :p
Update
Delete excisting Vote Site Code and replace with
<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
(in 1st post was v1.0)
Download version 1.01
DONT FORGET TO HIT INSTALL: INSTALL HERE (https://vborg.vbsupport.ru/misc.php?s=&action=install&threadid=46662)
Runnin Demo on Top (http://sat-gsm.dyndns.org/forum/)
Originally posted by Graphics
I've not installed it yet. But it seems like what I might be looking for. However, could you make it so that it works with images?
You'd have your vote my site. But then after you'd voted it would show you a big number 9 image or summin like that. Not sure if this is already implemented. :p
Don't think i can do this.
Cause $hoeveel (translated $howmuch) says how many numbers to rate (could be till 1000).
So when i want to add pictures in it, i would need to change the whole code. Maybe some1 else wants to change my code (with credtis)
Graphics
12-14-2002, 01:22 PM
All I would want is a vote from 1-10.
Vote from 1-10 is basic in this hack.
time4akshun
12-15-2002, 04:31 PM
Do you have a mockup as to what this looks like live? URL?
Here it is.
Made it simple with HTML, but this is how it looks like exact.
Automated
12-15-2002, 09:01 PM
nice lil hack but quite pointelss really :p
Could be usefull for someone who is looking for it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.