Advertisement
Guest User

Untitled

a guest
May 3rd, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. if ($site=="") {
  2. 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>';
  3. $ii=1;
  4. while ($ii < $votingsites+1) {
  5. if (time() >= strtotime($voted[$ii]) + 7200 && time() >= strtotime($ipvoted[$ii]) + 7200) {
  6. ?>
  7. <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>
  8. <?php
  9. } else {
  10. if(strtotime($voted[$ii]) >= strtotime($ipvoted[$ii])) {
  11. $votetime = strtotime($voted[$ii]);
  12. } else {
  13. $votetime = strtotime($ipvoted[$ii]);
  14. }
  15.  
  16. $now = time();
  17. $datediff = ($now - $votetime - 7200) * (-1);
  18.  
  19. $padHours = false;
  20. $hms = "";
  21. $hours = intval(intval($datediff) / 3600);
  22. $hms .= ($padHours)
  23. ? str_pad($hours, 2, "0", STR_PAD_LEFT). ":"
  24. : $hours. ":";
  25. $minutes = intval(($datediff / 60) % 60);
  26. $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ":";
  27. $seconds = intval($datediff % 60);
  28. $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT);
  29.  
  30. ?>
  31. <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>
  32. <?php
  33. }
  34. $ii++;
  35. }
  36.  
  37. ?>
  38. <form method="post" action="">
  39. <input type="hidden" id="redeem" name="redeem" value="redeem">
  40. <input type="image" class="submit" src="images/redeem.png"/>
  41. </form>
  42. </center>
  43.  
  44. <?php
  45. } elseif ($site=="Logout") {
  46. if ($_SESSION['voteuser'] != "") {
  47. session_destroy();
  48. echo '<script>document.location.replace("'.$voterlink.'");</script>';
  49. } else {
  50. session_destroy();
  51. echo '<script>document.location.replace("'.$voterlink.'");</script>';
  52. }
  53. } else {
  54. $ii=1;
  55. while ($ii < $votingsites+1) {
  56. if($site == $votingname[$ii]) {
  57. if (time() >= strtotime($voted[$ii]) + 7200 && time() >= strtotime($ipvoted[$ii]) + 7200) {
  58. $query2 = sprintf("SELECT COUNT(username) FROM vote_users WHERE UPPER(username) = UPPER('%s')", mysql_real_escape_string($username));
  59. $result2 = mysql_query($query2);
  60. list($count2) = mysql_fetch_row($result2);
  61.  
  62. if(!$count2 == 1) {
  63. $query = sprintf("INSERT INTO vote_users(username) VALUES ('$username')");
  64. mysql_query($query);
  65. }
  66. $votingdb = $votingdbname[$ii];
  67.  
  68. $query = sprintf("UPDATE vote_users SET $votingdb = NOW() WHERE UPPER(username) = UPPER('%s')",
  69. mysql_real_escape_string($username));
  70. mysql_query($query);
  71. $query = sprintf("UPDATE vote_ips SET $votingdb = NOW() WHERE ip = '$ip'");
  72. mysql_query($query);
  73. $query = sprintf("UPDATE vote_users SET points = points+1 WHERE UPPER(username) = UPPER('%s')",
  74. mysql_real_escape_string($username));
  75. mysql_query($query);
  76. $query = sprintf("UPDATE vote_users SET pointsleft = pointsleft+$voteamount WHERE UPPER(username) = UPPER('%s')",
  77. mysql_real_escape_string($username));
  78. mysql_query($query);
  79. echo '<META HTTP-EQUIV="Refresh" Content="0; URL='.$votinglink[$ii].'">';
  80. } else {
  81. echo 'You have already voted for the server in the last 24 hours.<br>';
  82. echo 'If you did not vote somebody on the same IP as you might have voted already.';
  83. }
  84. }
  85. $ii++;
  86. }
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement