From 0faafce4ce254ff282de801901372f67ca4f4415 Mon Sep 17 00:00:00 2001 From: callumacrae Date: Fri, 12 Jul 2013 21:52:10 -0400 Subject: [ticket/11672] Removed unnecessary text from alerts. Messages like "Return to forum last visited" are entirely unnecessary when using AJAX to delete a post, so this commit removes them. PHPBB3-11672 --- phpBB/posting.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index 5db36007c2..6e9cc1aa94 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -386,8 +386,12 @@ if ($mode == 'bump') $meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time); meta_refresh(3, $meta_url); - $message = $user->lang['TOPIC_BUMPED'] . '

' . $user->lang('VIEW_MESSAGE', '', ''); - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + $message = $user->lang['TOPIC_BUMPED']; + if (!$request->is_ajax()) + { + $message .= '

' . $user->lang('VIEW_MESSAGE', '', ''); + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + } trigger_error($message); } @@ -1616,7 +1620,7 @@ function upload_popup($forum_style = 0) */ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $soft_delete_reason = '') { - global $user, $db, $auth, $config; + global $user, $db, $auth, $config, $request; global $phpbb_root_path, $phpEx; $perm_check = ($is_soft) ? 'softdelete' : 'delete'; @@ -1662,11 +1666,18 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username); $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; - $message = $user->lang['POST_DELETED'] . '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + $message = $user->lang['POST_DELETED']; + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + } } meta_refresh(3, $meta_info); - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + if (!$request->is_ajax()) + { + $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + } trigger_error($message); } else -- cgit v1.2.1 From c6473da412d1a572ed80ec10d826239ad5ce5098 Mon Sep 17 00:00:00 2001 From: Cesar G Date: Thu, 17 Oct 2013 20:14:14 -0700 Subject: [ticket/11672] Replace sprintf() usage with $user->lang(). PHPBB3-11672 --- phpBB/posting.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'phpBB/posting.php') diff --git a/phpBB/posting.php b/phpBB/posting.php index 6e9cc1aa94..0d2cff40bc 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -385,12 +385,12 @@ if ($mode == 'bump') { $meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time); meta_refresh(3, $meta_url); - $message = $user->lang['TOPIC_BUMPED']; + if (!$request->is_ajax()) { $message .= '

' . $user->lang('VIEW_MESSAGE', '', ''); - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + $message .= '

' . $user->lang('RETURN_FORUM', '', ''); } trigger_error($message); @@ -1667,16 +1667,17 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_sof $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; $message = $user->lang['POST_DELETED']; + if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + $message .= '

' . $user->lang('RETURN_TOPIC', '', ''); } } meta_refresh(3, $meta_info); if (!$request->is_ajax()) { - $message .= '

' . sprintf($user->lang['RETURN_FORUM'], '', ''); + $message .= '

' . $user->lang('RETURN_FORUM', '', ''); } trigger_error($message); } -- cgit v1.2.1