summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-08-23 20:31:43 +0100
committerGitHub <noreply@github.com>2016-08-23 20:31:43 +0100
commitd3542f22adc6633a3a94666b5ca1c79a0af26140 (patch)
tree751e41ed0016b2f41e7066c4d0627fea594071a3
parent66d1b5bcd17b50fc7106bfb210e1dc55376b907b (diff)
parent8e0a8b12519be0f536489c4e7146d97284060c07 (diff)
Merge pull request #68 from 0xjove/moving-replies
Fixes bugs preventing replies from being moved.
-rw-r--r--inc/mod/pages.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index f7de6f42..d4d8f755 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1140,8 +1140,9 @@ function mod_move_reply($originBoard, $postID) {
// build index
buildIndex();
+
// build new thread
- buildThread($newID);
+ buildThread($post['op'] ? $newID : $post['thread']);
// trigger themes
rebuildThemes('post', $targetBoard);
@@ -1159,7 +1160,7 @@ function mod_move_reply($originBoard, $postID) {
openBoard($targetBoard);
// Find new thread on our target board
- $query = prepare(sprintf('SELECT thread FROM ``posts_%s`` WHERE `id` = :id', $targetBoard));
+ $query = prepare(sprintf('SELECT thread, id FROM ``posts_%s`` WHERE `id` = :id', $targetBoard));
$query->bindValue(':id', $newID);
$query->execute() or error(db_error($query));
$post = $query->fetch(PDO::FETCH_ASSOC);