summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-05-27 22:41:33 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-05-27 22:41:33 +1000
commit935304ce14333509e0288a857ffa6eb50e8a9be7 (patch)
tree115f24cb3ce8dc3ada03b722a4da7cfece268522
parent1191bbbd155a89a92bb9cee3ae5dda2a5d2149d6 (diff)
rebuild thread and indexes after public ban message
-rw-r--r--mod.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/mod.php b/mod.php
index e6a844dc..bd0cb334 100644
--- a/mod.php
+++ b/mod.php
@@ -1901,6 +1901,19 @@
$query->bindValue(':body', sprintf($config['mod']['ban_message'], htmlentities($_POST['message'])));
$query->execute() or error(db_error($query));
+ // Rebuild thread
+ $query = prepare(sprintf("SELECT `thread` FROM `posts_%s` WHERE `id` = :id", $board['uri']));
+ $query->bindValue(':id', $post, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+ $thread = $query->fetch();
+ if($thread['thread'])
+ buildThread($thread['thread']);
+ else
+ buildThread($post);
+
+ // Rebuild board
+ buildIndex();
+
// Record the action
modLog("Attached a public ban message for post #{$post}: " . $_POST['message']);
}