Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ($site=="") {
- echo '<center><table><tr><td><font face="Comic Sans MS" color="white">Welcome '.$username.'</font><br><font face="Comic Sans MS" color="darkgrey">Not you? <a href="'.$voterlink.'?site=Logout">Logout</a></font></td></tr></table>';
- $ii=1;
- while ($ii < $votingsites+1) {
- if (time() >= strtotime($voted[$ii]) + 7200 && time() >= strtotime($ipvoted[$ii]) + 7200) {
- ?>
- <a href="<?php echo $voterlink; ?>?site=<?php echo $votingname[$ii]; ?>" target="_blank" title="Click to vote"><button type="button" style="background: url('images/button.png');width:96;height:27"><?=$votingname[$ii];?></button></a><br>
- <?php
- } else {
- if(strtotime($voted[$ii]) >= strtotime($ipvoted[$ii])) {
- $votetime = strtotime($voted[$ii]);
- } else {
- $votetime = strtotime($ipvoted[$ii]);
- }
- $now = time();
- $datediff = ($now - $votetime - 7200) * (-1);
- $padHours = false;
- $hms = "";
- $hours = intval(intval($datediff) / 3600);
- $hms .= ($padHours)
- ? str_pad($hours, 2, "0", STR_PAD_LEFT). ":"
- : $hours. ":";
- $minutes = intval(($datediff / 60) % 60);
- $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ":";
- $seconds = intval($datediff % 60);
- $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
- ?>
- <a href="" title="Vote again in: <?php echo $hms; ?>"><button type="button" style="background: url('images/buttonp.png');width:96;height:27"><?=$votingname[$ii];?></button></a><br>
- <?php
- }
- $ii++;
- }
- ?>
- <form method="post" action="">
- <input type="hidden" id="redeem" name="redeem" value="redeem">
- <input type="image" class="submit" src="images/redeem.png"/>
- </form>
- </center>
- <?php
- } elseif ($site=="Logout") {
- if ($_SESSION['voteuser'] != "") {
- session_destroy();
- echo '<script>document.location.replace("'.$voterlink.'");</script>';
- } else {
- session_destroy();
- echo '<script>document.location.replace("'.$voterlink.'");</script>';
- }
- } else {
- $ii=1;
- while ($ii < $votingsites+1) {
- if($site == $votingname[$ii]) {
- if (time() >= strtotime($voted[$ii]) + 7200 && time() >= strtotime($ipvoted[$ii]) + 7200) {
- $query2 = sprintf("SELECT COUNT(username) FROM vote_users WHERE UPPER(username) = UPPER('%s')", mysql_real_escape_string($username));
- $result2 = mysql_query($query2);
- list($count2) = mysql_fetch_row($result2);
- if(!$count2 == 1) {
- $query = sprintf("INSERT INTO vote_users(username) VALUES ('$username')");
- mysql_query($query);
- }
- $votingdb = $votingdbname[$ii];
- $query = sprintf("UPDATE vote_users SET $votingdb = NOW() WHERE UPPER(username) = UPPER('%s')",
- mysql_real_escape_string($username));
- mysql_query($query);
- $query = sprintf("UPDATE vote_ips SET $votingdb = NOW() WHERE ip = '$ip'");
- mysql_query($query);
- $query = sprintf("UPDATE vote_users SET points = points+1 WHERE UPPER(username) = UPPER('%s')",
- mysql_real_escape_string($username));
- mysql_query($query);
- $query = sprintf("UPDATE vote_users SET pointsleft = pointsleft+$voteamount WHERE UPPER(username) = UPPER('%s')",
- mysql_real_escape_string($username));
- mysql_query($query);
- echo '<META HTTP-EQUIV="Refresh" Content="0; URL='.$votinglink[$ii].'">';
- } else {
- echo 'You have already voted for the server in the last 24 hours.<br>';
- echo 'If you did not vote somebody on the same IP as you might have voted already.';
- }
- }
- $ii++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement