diff options
| author | Michael Walker <mike@barrucadu.co.uk> | 2015-05-10 13:22:53 +0100 |
|---|---|---|
| committer | Michael Walker <mike@barrucadu.co.uk> | 2015-05-10 13:22:53 +0100 |
| commit | 61d9dacdfb1f8b51ea89f6f3077e56ed8f622644 (patch) | |
| tree | 4f448a2af95e35aa36bff71c069d1ac5131a9914 /inc/mod | |
| parent | 649255c9b9bff02686c1b7370474a414c70b8442 (diff) | |
When banning/deleting a post, return to the thread, not the board index (unless deleting the OP)
Diffstat (limited to 'inc/mod')
| -rw-r--r-- | inc/mod/pages.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 07fc4ddd..cb798767 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1431,8 +1431,14 @@ function mod_ban_post($board, $delete, $post, $token = false) { // Rebuild themes rebuildThemes('post-delete', $board); } - - header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); + + if(isset($_POST['thread'])) { + // Redirect to thread + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . str_replace('%d', $_POST['thread'], $config['file_page']), true, $config['redirect_http']); + } else { + // Redirect to board index. + header('Location: ?/' . sprintf($config['board_path'], $board) . $config['file_index'], true, $config['redirect_http']); + } } $args = array( @@ -1444,6 +1450,10 @@ function mod_ban_post($board, $delete, $post, $token = false) { 'boards' => listBoards(), 'token' => $security_token ); + + if($_GET['thread']) { + $args['thread'] = $_GET['thread']; + } mod_page(_('New ban'), 'mod/ban_form.html', $args); } |
