1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
<?php
/*<!--
*
* Ce fichier fait partie du HabbCMS
*
*
* Copyright (c) 2010-Now, Nox / HabbWorld
* Tous droits rservs.
* Distribution possible sur accord
*
-->*/
$titre = "Validation";
$timestamp_2h = time() - (60*120);
date_default_timezone_set('Europe/Paris');
$bdd = new PDO("mysql:host=".$host_sql.";dbname=".$db_sql."", $user_sql, $pass_sql);
if(isset($_GET['a']) && $_GET['a'] == 1)
{
if(isset($_SESSION['login']))
{
$req = $bdd->prepare('DELETE FROM accounts_ip WHERE timestamp < ?');
$req->execute(array($timestamp_2h));
$req = $bdd->prepare('SELECT * FROM accounts WHERE account = ?');
$req->execute(array($_SESSION['login']));
$data = $req->fetch();
$req = $bdd->prepare('SELECT * FROM accounts_ip WHERE ip = ?');
$req->execute(array($_SERVER['REMOTE_ADDR']));
$data2 = $req->fetch();
$erreur = "<p>Vous avez dj vot il y a moins de 2h ! ( 1 )</p>";
if($data['last_vote'] > $timestamp_2h)
{
?><p style=''>Vous avez dj vot il y a moins de 2h !</p><p>Vous pourrez voter nouveau <?php echo date("G", $data['last_vote']+7200); ?>h<?php echo date("i", $data['last_vote']); ?></p><?php
}
else if($data2['ip'] == $_SERVER['REMOTE_ADDR'])
{
?><p style=''>Vous avez dj vot il y a moins de 2h !( 2 )</p><?php
}
else if(isset($_COOKIE['vote_dofus']))
{
?><p style=''>Vous avez dj vot il y a moins de 2h ! ( 3 )</p><?php
}
else
{
setcookie('vote_dofus', $_SERVER['REMOTE_ADDR'], time() + 7200);
$PointWeb = $data['PointWeb'] + 15;
$vote = $data['vote'] + 1;
$req = $bdd->prepare('UPDATE accounts SET PointWeb = :PointWeb, last_vote = :last_vote, vote = :vote WHERE account = :account');
$req->execute(array(
'PointWeb' => $PointWeb,
'last_vote' => time(),
'vote' => $vote,
'account' => $_SESSION['login']
));
$req = $bdd->prepare('INSERT INTO accounts_ip(ip,timestamp) VALUES(:ip, :timestamp)');
$req->execute(array(
'ip' => $_SERVER['REMOTE_ADDR'],
'timestamp' => time()
));
header("Location: http://rpg-paradize.com/?page=vote&vote=29629");
}
} else
{
header("Location: http://rpg-paradize.com/?page=vote&vote=29629");
}
} else
{
if(isset($_SESSION['login']))
{
$req = mysql_query('SELECT * FROM accounts_p WHERE name = "'.$_SESSION['login'].'"');
$data = mysql_fetch_array($req);
if($data['last_vote'] > $timestamp_2h)
{
if(isset($_GET['a']) && $_GET['a'] == 2)
{
echo "<p>Votre vote a bien t pris en compte !</p>";
}
else
{
?><p style=''>Vous avez dj vot il y a moins de 2h !</p><p>Vous pourrez voter nouveau <?php echo date("G", $data['last_vote']+7200); ?>h<?php echo date("i", $data['last_vote']); ?></p><?php
}
} else
{
$req = $bdd->prepare('SELECT * FROM accounts_ip WHERE ip = ?');
$req->execute(array($_SERVER['REMOTE_ADDR']));
$data5 = $req->fetch();
if($data5['ip'] == $_SERVER['REMOTE_ADDR'])
{
?><p style=''>Vous avez dj vot il y a moins de 2h !</p><p>Vous pourrez voter nouveau <?php echo date("G", $data5['timestamp']+7200); ?>h<?php echo date("i", $data['timestamp']); ?></p><?php
}
else if(isset($_COOKIE['vote_dofus']))
{
echo "<p>Vous avez dj vot il y a moins de 2h ! ( 4 )</p>";
}
else
{
?>
<p style="margin-left:30px;padding-right:20px;margin-top:80px;font-size:11px;">
<u><b>Voter avec plusieurs comptes est strictement interdit</u></b><br>
Voter pour <b></b> lui permettra d'être plus connu au sien des autres et ainsi avoir des chances d'agrandir sa communautée.<br /><br />
Une communauté plus grande implique une meilleur ambiance et surtout de nouveaux compagnons avec qui braver mille et une aventure. <br /><br />
Pour finir, chaque vote vous rapportera <b style="color:#1a9aa5;">PointWeb </b> qui vous permettrons d'acheter de <b>
nouveaux objets tous plus puissant les uns que les autres</b>. <br /><br />
Si vous voulez plus de points, <a href="buypoints.php">cliquez ici.</a><br /><br />
<center><a onClick="javascript:window.open(this.href);parent.location.reload();return false" href="index.php?page=vote&a=1"><p align="center"><img src="/images/btn_vote.png" style="margin-left:210px;" ></p></a></center>
</p>
<?php
}
}
} else
{
?>
<center>
<h3 style="margin-top:50px;"> <font style="color:red;">Vous n'tes pas connect.</font><br /><br />
Si vous avez un compte, connectez vous. <br /> Si vous n'avez pas de compte, vous pouvez toujours voter pour faire avancer le serveur. <br /></h3>
<center><a onClick="javascript:window.open(this.href);return false" href="index.php?page=vote&a=1"<img src="/images/btn_vote.png" style="margin-left:210px;" ></a>
</center>
<?php
}
}
?> |