PDA

View Full Version : Vote my Site


flup
14 Dec 2002, 12:00
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
14 Dec 2002, 12:03
Sounds good:)

Satan

flup
14 Dec 2002, 12:08
Yub, are bussy with design now

Graphics
14 Dec 2002, 12:28
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
14 Dec 2002, 12:31
I will see.

flup
14 Dec 2002, 12:32
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
14 Dec 2002, 12:37
(in 1st post was v1.0)

Download version 1.01

DONT FORGET TO HIT INSTALL: INSTALL HERE (http://www.vbulletin.org/forum/misc.php?s=&action=install&threadid=46662)
Runnin Demo on Top (http://sat-gsm.dyndns.org/forum/)

flup
14 Dec 2002, 12:54
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
14 Dec 2002, 14:22
All I would want is a vote from 1-10.

flup
14 Dec 2002, 14:24
Vote from 1-10 is basic in this hack.

time4akshun
15 Dec 2002, 17:31
Do you have a mockup as to what this looks like live? URL?

flup
15 Dec 2002, 17:42
ofcourz

flup
15 Dec 2002, 17:49
Here it is.
Made it simple with HTML, but this is how it looks like exact.

Automated
15 Dec 2002, 22:01
nice lil hack but quite pointelss really :p

flup
16 Dec 2002, 14:50
Could be usefull for someone who is looking for it.