<?
session_start();
import_request_variables("gPc");
extract($_SESSION);
//*****SETTINGS
$reward="100"; // turns to give per vote
//*****************
if($_SESSION['user_email']==NULL || $_SESSION['user_password']==NULL) {
echo "Error loading user information. To correct this error you may need to restart your web browser, or you may need to switch browsers temporarily to vote.";
exit;
}
include('../includes/config.php');
if (!($game=mysql_connect($gamedbhost,$gamedbuser,$gamedbpassword)))
{
print "Connection to the $gamename.ls.com game database failed. Please refresh this page to try again.<br>";
exit;
}
$gamedb=mysql_select_db("leavs");
$offers = array (
1 => "http://www.gamesites100.net/in.php?site=11571",
2 => "http://www.xtremetop100.com/in.php?site=1132242257",
3 => "http://www.gtop100.com/in.php?site=22724",
);
if ($va=="vote" AND $vo <= 3 AND $vo <= count($offers)) {
if($offers[$vo]=='')
{
exit;
}
if($vo > '3'){
$time=time();
$ip = $_SERVER['REMOTE_ADDR'];
$sql="INSERT INTO `cheat_check` (`email`,`page`,`ip`,`time') VALUES ('$_SESSION[user_email]', 'Voting Offers','$ip','$time')";
$sql=mysql_query($sql);
die("Cheater, Your IP has been logged!");
exit;
}
$time=time();
$sql="SELECT * FROM voting_offers WHERE email='$_SESSION[user_email]'";
$sql=mysql_query($sql);
$getarray=mysql_fetch_array($sql);
$timeout = $time - $getarray[$vo];
if ($getarray[email]=="")
{
$sql="INSERT INTO `voting_offers` (`email`,`$vo`) VALUES ('$_SESSION[user_email]', '$time')";
$sql=mysql_query($sql);
$sql="UPDATE `voting_offers` SET `$vo`='$time' WHERE email='$_SESSION[user_email]'";
$sql=mysql_query($sql);
$sql="UPDATE `user_characters` SET tokens=tokens+100 WHERE email='$_SESSION[user_email]'";
$sql=mysql_query($sql);
echo "<center><b>You will be redirected to the voting site in a moment...<br><br>Fail to load automatically? <a href=$offers[$vo]>Click here</a>
<script>window.location='$offers[$vo]'</script>
";
}
else
{
if ($timeout < 86400)
{
$clickagain=$getarray[$vo]+86400;
$time_left = $clickagain - $time;;
$time_left = (floor($time_left/86400))."d ".floor(($time_left-(floor($time_left/86400)*86400))/3600)."h ".floor(($time_left-(floor($time_left/3600)*3600))/60)."m ".floor($time_left-(floor($time_left/60))*60)."s";
echo "<title>LS: Vote for turns</title><body bgcolor=#000000><font face=arial size=2 color=#FFFFFF>";
echo "You have already voted on this in the past 24 hours, but you may be able to vote on some of the other sites.<br><br>
You may vote on this again in: $time_left";
}
else
{
$sql="UPDATE `voting_offers` SET `$vo`='$time' WHERE email='$_SESSION[user_email]'";
$sql=mysql_query($sql);
$sql="UPDATE `user_characters` SET tokens=tokens+100 WHERE email='$_SESSION[user_email]'";
$sql=mysql_query($sql);
echo "<center><b>You will be redirected to the voting site in a moment...<br><br>Fail to load automatically? <a href=$offers[$vo]>Click here</a>
<script>window.location='$offers[$vo]'</script>
";
}
}
}
?>