From 23b27d805740599b968d41e08d726f2a0dc5bdde Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 16 Jul 2013 01:38:24 -0400 Subject: Add clean() to mod_move function --- inc/mod/pages.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 86f5ee52..fddf63c7 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -906,8 +906,10 @@ function mod_move($originBoard, $postID) { modLog("Moved thread #${postID} to " . sprintf($config['board_abbreviation'], $targetBoard) . " (#${newID})", $originBoard); - // build new hread + // build new thread buildThread($newID); + + clean(); buildIndex(); // trigger themes -- cgit v1.3 From 2144d43f2b114ac697d57d23300f51bf7d078b3b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 16 Jul 2013 02:27:20 -0400 Subject: Fix issue #24 --- inc/mod/pages.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'inc/mod/pages.php') diff --git a/inc/mod/pages.php b/inc/mod/pages.php index fddf63c7..899f2611 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -217,6 +217,19 @@ function mod_edit_board($boardName) { $query = prepare('DELETE FROM `antispam` WHERE `board` = :board'); $query->bindValue(':board', $board['uri']); $query->execute() or error(db_error($query)); + + // Remove board from users/permissions table + $query = query('SELECT `id`,`boards` FROM `mods`') or error(db_error()); + while ($user = $query->fetch(PDO::FETCH_ASSOC)) { + $user_boards = explode(',', $user['boards']); + if (in_array($board['uri'], $user_boards)) { + unset($user_boards[array_search($board['uri'], $user_boards)]); + $_query = prepare('UPDATE `mods` SET `boards` = :boards WHERE `id` = :id'); + $_query->bindValue(':boards', implode(',', $user_boards)); + $_query->bindValue(':id', $user['id']); + $_query->execute() or error(db_error($_query)); + } + } } else { $query = prepare('UPDATE `boards` SET `title` = :title, `subtitle` = :subtitle WHERE `uri` = :uri'); $query->bindValue(':uri', $board['uri']); -- cgit v1.3 From 7302fc57a8f83c6fe40f9c751259d9c616ebdaec Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Tue, 16 Jul 2013 02:32:44 -0400 Subject: Automatically dismiss all reports regarding a thread after it is locked. --- inc/config.php | 3 +++ inc/mod/pages.php | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'inc/mod/pages.php') diff --git a/inc/config.php b/inc/config.php index da9309e8..83b98c2b 100644 --- a/inc/config.php +++ b/inc/config.php @@ -881,6 +881,9 @@ // Edit raw HTML in posts by default $config['mod']['raw_html_default'] = false; + // Automatically dismiss all reports regarding a thread when it is locked + $config['mod']['dismiss_reports_on_lock'] = true; + // Probably best not to change these: if (!defined('JANITOR')) { define('JANITOR', 0, true); diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 899f2611..3f823d3d 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -738,6 +738,13 @@ function mod_lock($board, $unlock, $post) { buildIndex(); } + if ($config['mod']['dismiss_reports_on_lock']) { + $query = prepare('DELETE FROM `reports` WHERE `board` = :board AND `post` = :id'); + $query->bindValue(':board', $board); + $query->bindValue(':id', $post); + $query->execute() or error(db_error($query)); + } + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); if ($unlock) -- cgit v1.3