Browse Source

Automatically dismiss all reports regarding a thread after it is locked.

pull/40/head
Michael Foster 11 years ago
parent
commit
7302fc57a8
  1. 3
      inc/config.php
  2. 7
      inc/mod/pages.php

3
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);

7
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)

Loading…
Cancel
Save