Advertisement
Guest User

Untitled

a guest
Aug 5th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. <?php
  2. // This file is ripped from MapleSakeo/AsteriaCMS.
  3. // I take no credits to this file except for editing it.
  4. // © 2010 - MapleSakeo/AuroX.
  5. if (@$_POST["doVote"] != "1") {
  6. ?>
  7. <center><br />
  8. <div id="message-yellow">Not interested in any rewards, but still wanna vote? <a href="<?php echo $votelink; ?>" target="_blank">Click Here</a></div><br />
  9. <b>Welcome to the Vote Page!</b><br />
  10. You can vote for us every <u>12 hours</u>, and get rewards for voting.<br /><br />
  11. <b>Attention: Once transferred to vote page, please type the word you read in the captcha image and click "Submit".</b><br /><br />
  12. Also, once you click submit, your Account and IP Address will be <u>logged</u>.<br /><b><font color="red">Please don't try to fool us with fake votes, bypasses, ect.<br>You may get suspended/banned.</font></b><br /><br />
  13. <b>Below, please fill in your login credentials.</b><br />Click submit once filled out to get confirmed.<br />
  14. XXk NX and X Vote Points will be added to your account
  15. <br /><br />
  16.  
  17. <form action="?page=vote" method="POST"><br>
  18. <table border="0" cellspacing="10" cellpadding="0">
  19. <tr>
  20. <td width="30%" align="right">Username :</td>
  21. <td align="left"><input type="text" name="name" maxlength="12" /></td>
  22. </tr>
  23. <tr>
  24. <td width="30%" align="right">Password :</td>
  25. <td align="left"><input type="password" name="password" maxlength="12" /></td>
  26. </tr>
  27. <tr></tr>
  28. <tr>
  29. <td align="right" colspan="2">
  30. <center>
  31. <input type="submit" name="doVote" value="Submit" class="doVote">
  32. <input type="hidden" name="doVote" value="1">
  33. </center>
  34. </td>
  35. </tr>
  36. </table>
  37. </form>
  38. </center>
  39. <?php
  40. } else {
  41. $earnednx = false;
  42. $account = $_POST['name'];
  43. $account = mysql_real_escape_string($account);
  44. mysql_select_db($host['database']);
  45. $query=mysql_query("SELECT * FROM accounts WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  46. $info=mysql_fetch_assoc($query);
  47. if($_POST["name"] == "") {
  48. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  49. } elseif($_POST["password"] == "") {
  50. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  51. } elseif(mysql_num_rows($query) < 1) {
  52. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  53. } elseif($info["password"] !== $_POST["password"]) {
  54. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  55. } elseif($info["loggedin"] > 0) {
  56. echo '<div id="message-yellow">You must be logged out to vote for rewards.</div>';
  57. } else {
  58. $ip = $_SERVER['REMOTE_ADDR'];
  59. $time = time();
  60. $get = "SELECT *, SUM(`times`) as amount FROM voterecords WHERE account='$account'";
  61. $query1 = mysql_query($get);
  62. $lasttime = mysql_fetch_array($query1);
  63. $amount = $lasttime['amount'];
  64. $insertnew = false;
  65. if ($amount == "") {
  66. $insertnew = true;
  67. }
  68. else
  69. {
  70. $insertnew = true;
  71. }
  72. $timecalc = $time - $lasttime['date'];
  73. if ($insertnew == false) {
  74. if ($timecalc < 43200) { // 43200 ms is 12 hours
  75. date_default_timezone_set(''.$timezone.'');
  76. $_SESSION['vote_date'] = date('M d\, h:i:s A', $lasttime['date']);
  77. echo '<div id="message-yellow">You\'ve already voted with this account in the past 12 hours!<br />Last time you voted was on: '.$_SESSION['vote_date'].'!</div>';
  78. } else {
  79. $update = mysql_query("SELECT * from voterecords WHERE ip='$ip' AND account = '$account'");
  80. if (mysql_num_row($update) == 1) {
  81. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE account='$account'");
  82. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE ip='$ip'");
  83. $earnednx = true;
  84. }
  85. } elseif ($insertnew == true) {
  86. $success = mysql_query("INSERT INTO voterecords (`account`, `ip`, `date`, `times`) VALUES ('$account', '$ip', '$time', 1)");
  87. if (!$success) {
  88. $message = 'Invalid query: ' . mysql_error() . "\n";
  89. $message .= 'Whole query: ' . $success;
  90. die($message);
  91. } else {
  92. $earnednx = true;
  93. }
  94. }
  95. // Insert the NX into the db now
  96. if ($earnednx) {
  97. mysql_query("UPDATE accounts SET votepoints = votepoints + '2' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  98. mysql_query("UPDATE accounts SET mPoints = mPoints + '2500' WHERE name='" .mysql_real_escape_string($_POST["name"]) . "'");
  99. mysql_query("UPDATE accounts SET lastvote='" .time(). "' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  100. mysql_close();
  101. echo '<html>';
  102. echo '<head>';
  103. unset($_SESSION['vote_err']);
  104. echo '<meta HTTP-EQUIV="REFRESH" content="0; url=asdf.com">';
  105. echo '</head>';
  106. echo '</html>';
  107. }
  108. }
  109. }
  110. }
  111. ?><!-- END VOTE SCRIPT -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement