1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

rebuild thread and indexes after public ban message

This commit is contained in:
Savetheinternet 2011-05-27 22:41:33 +10:00
parent 1191bbbd15
commit 935304ce14

13
mod.php
View File

@ -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']);
}