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.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index c7722763..be713f57 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1161,7 +1161,7 @@ function mod_move_reply($originBoard, $postID) {
$post = $query->fetch(PDO::FETCH_ASSOC);
// redirect
- header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $newID) . '#' . $newID, true, $config['redirect_http']);
+ header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . link_for($post) . '#' . $newID, true, $config['redirect_http']);
}
else {
@@ -1224,7 +1224,10 @@ function mod_move($originBoard, $postID) {
// create the new thread
$newID = post($post);
-
+
+ $op = $post;
+ $op['id'] = $newID;
+
if ($post['has_file']) {
// copy image
foreach ($post['files'] as $i => &$file) {
@@ -1322,6 +1325,8 @@ function mod_move($originBoard, $postID) {
// trigger themes
rebuildThemes('post', $targetBoard);
+ $newboard = $board;
+
// return to original board
openBoard($originBoard);
@@ -1332,7 +1337,7 @@ function mod_move($originBoard, $postID) {
$query->execute() or error(db_error($query));
// leave a reply, linking to the new thread
- $post = array(
+ $spost = array(
'mod' => true,
'subject' => '',
'email' => '',
@@ -1346,23 +1351,23 @@ function mod_move($originBoard, $postID) {
'op' => false
);
- $post['body'] = $post['body_nomarkup'] = sprintf($config['mod']['shadow_mesage'], '>>>/' . $targetBoard . '/' . $newID);
+ $spost['body'] = $spost['body_nomarkup'] = sprintf($config['mod']['shadow_mesage'], '>>>/' . $targetBoard . '/' . $newID);
- markup($post['body']);
+ markup($spost['body']);
- $botID = post($post);
+ $botID = post($spost);
buildThread($postID);
buildIndex();
- header('Location: ?/' . sprintf($config['board_path'], $originBoard) . $config['dir']['res'] .sprintf($config['file_page'], $postID) .
+ header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard) .
'#' . $botID, true, $config['redirect_http']);
} else {
deletePost($postID);
buildIndex();
openBoard($targetBoard);
- header('Location: ?/' . sprintf($config['board_path'], $board['uri']) . $config['dir']['res'] . sprintf($config['file_page'], $newID), true, $config['redirect_http']);
+ header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']);
}
}
@@ -1494,7 +1499,7 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
rebuildThemes('post', $board);
- header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . sprintf($config['file_page'], $post['thread'] ? $post['thread'] : $postID) . '#' . $postID, true, $config['redirect_http']);
+ header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . link_for($post) . '#' . $postID, true, $config['redirect_http']);
} else {
if ($config['minify_html']) {
$post['body_nomarkup'] = str_replace("\n", '
', utf8tohtml($post['body_nomarkup']));