From 649255c9b9bff02686c1b7370474a414c70b8442 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Sun, 10 May 2015 03:01:55 +0100 Subject: [PATCH] When deleting a post, return to the thread, not the board index (unless deleting the OP) --- inc/mod/pages.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index c8d3e2ad..07fc4ddd 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1529,7 +1529,11 @@ function mod_delete($board, $post) { // Rebuild themes rebuildThemes('post-delete', $board); // Redirect - header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); + if(isset($_GET['thread'])) { + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_GET['thread'], $config['file_page']), true, $config['redirect_http']); + } else { + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); + } } function mod_deletefile($board, $post, $file) {