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 842B

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