mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 10:56:26 +00:00
73 lines
1.6 KiB
PHP
73 lines
1.6 KiB
PHP
<?
|
|
|
|
enforce_login();
|
|
if(!check_perms('site_moderate_forums')) {
|
|
error(403);
|
|
}
|
|
|
|
|
|
$ForumID = $_GET['forumid'];
|
|
if(!is_number($ForumID)) {
|
|
error(404);
|
|
}
|
|
|
|
|
|
if(!empty($_POST['add']) || (!empty($_POST['del']))) {
|
|
if(!empty($_POST['add'])) {
|
|
if(is_number($_POST['new_thread'])) {
|
|
$DB->query("INSERT INTO forums_specific_rules (ForumID, ThreadID) VALUES (".$ForumID.", ".$_POST['new_thread'].")");
|
|
}
|
|
}
|
|
if(!empty($_POST['del'])) {
|
|
if(is_number($_POST['threadid'])) {
|
|
$DB->query("DELETE FROM forums_specific_rules WHERE ForumID = ".$ForumID." AND ThreadID = ".$_POST['threadid']);
|
|
}
|
|
}
|
|
$Cache->delete_value('forums_list');
|
|
}
|
|
|
|
|
|
$DB->query("SELECT ThreadID FROM forums_specific_rules WHERE ForumID = ".$ForumID);
|
|
$ThreadIDs = $DB->collect('ThreadID');
|
|
|
|
show_header();
|
|
?>
|
|
<div class="thin box pad">
|
|
<h2>
|
|
<a href="forums.php">Forums</a>
|
|
>
|
|
<a href="forums.php?action=viewforum&forumid=<?=$ForumID?>"><?=$Forums[$ForumID]['Name']?></a>
|
|
>
|
|
Edit forum specific rules
|
|
</h2>
|
|
<table>
|
|
<tr class="colhead">
|
|
<td>Thread ID</td>
|
|
<td></td>
|
|
</tr>
|
|
<tr>
|
|
<form action="" method="post">
|
|
<td>
|
|
<input name="new_thread" type="text" size="8" />
|
|
</td>
|
|
<td>
|
|
<input type="submit" name="add" value="Add thread" />
|
|
</td>
|
|
</form>
|
|
<? foreach($ThreadIDs as $ThreadID) { ?>
|
|
<tr>
|
|
<td><?=$ThreadID?></td>
|
|
<td>
|
|
<form action="" method="post">
|
|
<input type="hidden" name="threadid" value="<?=$ThreadID?>" />
|
|
<input type="submit" name="del" value="Delete link" />
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
<? } ?>
|
|
</table>
|
|
</div>
|
|
<?
|
|
show_footer();
|
|
?>
|