PDA

View Full Version : Vote my Site


flup
12-13-2002, 10:00 PM
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

flup
12-14-2002, 11:08 AM
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

flup
12-14-2002, 11:31 AM
I will see.

flup
12-14-2002, 11:32 AM
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

flup
12-14-2002, 11:37 AM
(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/)

flup
12-14-2002, 11:54 AM
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.

flup
12-14-2002, 01:24 PM
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?

flup
12-15-2002, 04:42 PM
ofcourz

flup
12-15-2002, 04:49 PM
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

flup
12-16-2002, 01:50 PM
Could be usefull for someone who is looking for it.