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.

edit_rules.php 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. enforce_login();
  3. if (!check_perms('site_moderate_forums')) {
  4. error(403);
  5. }
  6. $ForumID = $_GET['forumid'];
  7. if (!is_number($ForumID)) {
  8. error(404);
  9. }
  10. if (!empty($_POST['add']) || (!empty($_POST['del']))) {
  11. if (!empty($_POST['add'])) {
  12. if (is_number($_POST['new_thread'])) {
  13. $DB->query("
  14. INSERT INTO forums_specific_rules (ForumID, ThreadID)
  15. VALUES ($ForumID, ".$_POST['new_thread'].')');
  16. }
  17. }
  18. if (!empty($_POST['del'])) {
  19. if (is_number($_POST['threadid'])) {
  20. $DB->query("
  21. DELETE FROM forums_specific_rules
  22. WHERE ForumID = $ForumID
  23. AND ThreadID = ".$_POST['threadid']);
  24. }
  25. }
  26. $Cache->delete_value('forums_list');
  27. }
  28. $DB->query("
  29. SELECT ThreadID
  30. FROM forums_specific_rules
  31. WHERE ForumID = $ForumID");
  32. $ThreadIDs = $DB->collect('ThreadID');
  33. $ENV = ENV::go();
  34. View::show_header();
  35. ?>
  36. <div class="box pad">
  37. <div class="header">
  38. <h2>
  39. <a href="forums.php">Forums</a>
  40. <?=$ENV->CRUMB?>
  41. <a
  42. href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>"><?=$Forums[$ForumID]['Name']?></a>
  43. <?=$ENV->CRUMB?>
  44. Edit forum specific rules
  45. </h2>
  46. </div>
  47. <table>
  48. <tr class="colhead">
  49. <td>
  50. Thread ID
  51. </td>
  52. <td></td>
  53. </tr>
  54. <tr>
  55. <form class="add_form" name="forum_rules" action="" method="post">
  56. <td>
  57. <input name="new_thread" type="text" size="8" />
  58. </td>
  59. <td>
  60. <input type="submit" name="add" value="Add thread" />
  61. </td>
  62. </form>
  63. <?php foreach ($ThreadIDs as $ThreadID) { ?>
  64. <tr>
  65. <td>
  66. <?=$ThreadID?>
  67. </td>
  68. <td>
  69. <form class="delete_form" name="forum_rules" action="" method="post">
  70. <input type="hidden" name="threadid"
  71. value="<?=$ThreadID?>" />
  72. <input type="submit" name="del" value="Delete link" />
  73. </form>
  74. </td>
  75. </tr>
  76. <?php } ?>
  77. </table>
  78. </div>
  79. <?php View::show_footer();