0.5); //$user="toponlinerpg"; //$password="WZmpZK4k"; //$database="toponlinerpg"; //$databaseURL="mysql://toponlinerpg.mysql.domeneshop.no"; $VOTETIMEOUT = 60*60*24; // XXX $gameId=$_GET['gameId']; if (strlen(trim($gameId))==0) $gameId = 0; $month = date ("n", time()); if (date ("Y", time())>'2006') $month = date ("Yn", time()); //mysql_connect($databaseURL,$user,$password); // //if (!@mysql_select_db($database)) { // die('Problems connecting database: ' . mysql_error()); //} $result = mysql_query("SELECT * FROM games WHERE gameId=$gameId"); $nEntries = mysql_numrows($result); if ($nEntries == 0) { die('Sorry, the game you want give your vote to does not exist.'); } $gameName = mysql_result($result,$i,"gameName"); $hasClicked = $_POST['hasClicked']; // print "XXX: " . $hasClicked; if ($hasClicked!='hasClicked321') { if ($gameId == 43) { // supremacy1911 } else { print "
Click the button below to verify that you want to vote for $gameName.
"; } if (1==0) { // if ($adOverOrUnderButton) { ?>
Your Ad Here

Due to click irregularities, $gameName is no longer featured on this site.

"; } else { print "
"; } } else { $adOverOrUnderButton = 0; if (@mysql_select_db($database)) { $ip = getenv("REMOTE_ADDR"); $qResult = mysql_query("SELECT * FROM votedIps WHERE (ip='$ip') AND (gameIdVotedFor='$gameId')"); $nEntries = mysql_numrows($qResult); $now = time(); $failed = false; if ($nEntries==0) { mysql_query("INSERT INTO votedIps (ip, timestamp, gameIdVotedFor) VALUES ('$ip', '$now', $gameId)"); } else { $vTimestamp = mysql_result($qResult,0,"timestamp"); if ( ($now-$vTimestamp) < $VOTETIMEOUT ) { print "

You must wait 24 hours between each time you vote for a game!

"; $failed = true; } else { mysql_query("UPDATE votedIps SET timestamp='$now' WHERE (ip='$ip') AND (gameIdVotedFor='$gameId')"); } } if (!$failed) { $result = mysql_query("SELECT * FROM games WHERE gameId=$gameId"); $nEntries = mysql_numrows($result); if ($nEntries > 0) { $name = mysql_result($result,$i,"gameName"); print "

Your vote for $name has been recorded!

"; $result = mysql_query("SELECT votes FROM gameVotes WHERE (gameId='$gameId') AND (month=$month)"); $votes = mysql_result($result,0,"votes") + 1; mysql_query("UPDATE gameVotes SET votes='$votes' WHERE (gameId='$gameId') AND (month=$month)"); if (0==1) { // Show thank you for voting ad ?>
To Top Online RPG front page"; } else { print "
To Top Online RPG front page | To $gameName page"; } ?>