BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

change_vote.php 816B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. authorize();
  3. $ThreadID = $_GET['threadid'];
  4. $NewVote = $_GET['vote'];
  5. if (is_number($ThreadID) && is_number($NewVote)) {
  6. if (!check_perms('site_moderate_forums')) {
  7. $DB->query("
  8. SELECT
  9. `ForumID`
  10. FROM
  11. `forums_topics`
  12. WHERE
  13. `ID` = $ThreadID
  14. ");
  15. list($ForumID) = $DB->next_record();
  16. /*
  17. if (!in_array($ForumID, FORUMS_TO_REVEAL_VOTERS)) {
  18. error(403);
  19. }
  20. */
  21. }
  22. $DB->query("
  23. UPDATE
  24. `forums_polls_votes`
  25. SET
  26. `Vote` = $NewVote
  27. WHERE
  28. `TopicID` = $ThreadID
  29. AND `UserID` = ".$LoggedUser['ID']
  30. );
  31. $Cache->delete_value("polls_$ThreadID");
  32. header("Location: forums.php?action=viewthread&threadid=$ThreadID");
  33. } else {
  34. error(404);
  35. }