summaryrefslogtreecommitdiff
path: root/inc/mod/pages.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/mod/pages.php')
-rw-r--r--inc/mod/pages.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index ca6a2540..caec6443 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1013,8 +1013,14 @@ function mod_deletefile($board, $post) {
deleteFile($post);
// Record the action
modLog("Deleted file from post #{$post}");
+
+ $query = prepare(sprintf('SELECT `thread` FROM `posts_%s` WHERE `id` = :id', $board));
+ $query->bindValue(':id', $post);
+ $query->execute() or error(db_error($query));
+ $thread = $query->fetchColumn();
+
// Rebuild thread
- buildThread($post);
+ buildThread($thread ? $thread : $post);
// Rebuild board
buildIndex();