From 0d12b14ded503ad1709fc36b5a477daffc2022d2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 9 May 2007 21:40:06 +0000 Subject: [PATCH] add possibility to return to post after approval (if approving one post) - very helpful if using approval links from within topics. git-svn-id: file:///svn/phpbb/trunk@7520 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_queue.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index f42101067e..b3f7e158b2 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -627,6 +627,12 @@ function approve_post($post_id_list, $id, $mode) user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id); } } + + if (sizeof($post_id_list) == 1) + { + $post_data = $post_info[$post_id_list[0]]; + $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_data['forum_id']}&t={$post_data['topic_id']}&p={$post_data['post_id']}") . '#p' . $post_data['post_id']; + } unset($post_info); if ($total_topics) @@ -658,7 +664,15 @@ function approve_post($post_id_list, $id, $mode) else { meta_refresh(3, $redirect); - trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], "", '')); + + // If approving one post, also give links back to post... + $add_message = ''; + if (sizeof($post_id_list) == 1 && !empty($post_url)) + { + $add_message = '

' . sprintf($user->lang['RETURN_POST'], '', ''); + } + + trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], "", '') . $add_message); } }