diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-16 02:32:44 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-07-16 02:32:44 -0400 |
| commit | 7302fc57a8f83c6fe40f9c751259d9c616ebdaec (patch) | |
| tree | 0c53b9e153fd07b17141a7cc0209ea55f6dffa44 | |
| parent | 2144d43f2b114ac697d57d23300f51bf7d078b3b (diff) | |
Automatically dismiss all reports regarding a thread after it is locked.
| -rw-r--r-- | inc/config.php | 3 | ||||
| -rw-r--r-- | inc/mod/pages.php | 7 |
2 files changed, 10 insertions, 0 deletions
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) |
