summaryrefslogtreecommitdiff
path: root/inc/mod
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-09-28 04:00:13 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-09-28 04:00:13 +1000
commitdb14f9ce15e460eb5e0ff0e4419d59afa244df9c (patch)
tree447a012ccbde1cc1ec10c19753ba5810e27bc6b8 /inc/mod
parentac9296169f9b60741552c9566650f63f66820726 (diff)
Bugfix: [F]
Diffstat (limited to 'inc/mod')
-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();