diff options
| author | czaks <marcin@6irc.net> | 2015-03-10 14:22:47 +0100 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2015-03-10 14:22:47 +0100 |
| commit | bf1b6103cf6d3cf7f83e85453aad2d03e03e62da (patch) | |
| tree | 9460a02b2e7629059349fb88cacb1ad54bab1814 /inc/mod/pages.php | |
| parent | 6c4d3941fa729558f4a5313081c85b0a06202e54 (diff) | |
| parent | 4bf525599e7c596e7aec7f483664a091ef0db57b (diff) | |
Merge branch 'master' of github.com:vichan-devel/Tinyboard
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 23 |
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'])); |
