diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f03e4c01d0..8829554276 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1128,7 +1128,7 @@ function display_user_activity(&$userdata) */ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '') { - global $template, $db, $user, $phpEx, $start, $phpbb_root_path; + global $template, $db, $user, $phpEx, $start, $phpbb_root_path, $request; global $request; $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; @@ -1167,7 +1167,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, if ($uid != $user_id || $request->variable('unwatch', '', false, \phpbb\request\request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['ERR_UNWATCHING'] . '

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

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } trigger_error($message); } @@ -1177,8 +1181,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $db->sql_query($sql); $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '

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

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } meta_refresh(3, $redirect_url); trigger_error($message); } @@ -1232,7 +1239,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, if ($uid != $user_id || $request->variable('watch', '', false, \phpbb\request\request_interface::GET) != $mode) { $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['ERR_WATCHING'] . '

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

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } trigger_error($message); } @@ -1243,7 +1254,11 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $db->sql_query($sql); $redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start"); - $message = $user->lang['ARE_WATCHING_' . strtoupper($mode)] . '

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

' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '', ''); + } meta_refresh(3, $redirect_url); trigger_error($message); } diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index db461d07fa..365a794253 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -873,7 +873,7 @@ class mcp_queue $add_message = '

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

' . sprintf($user->lang['RETURN_PAGE'], '', '') . $add_message; + $message = $user->lang[$success_msg]; if ($request->is_ajax()) { @@ -885,6 +885,10 @@ class mcp_queue 'visible' => true, )); } + else + { + $message .= '

' . sprintf($user->lang['RETURN_PAGE'], "", '') . $add_message; + } trigger_error($message); } 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 diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3a7e633c99..ffb938a622 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -497,11 +497,20 @@ if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('b AND topic_id = $topic_id"; $db->sql_query($sql); } - $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']) . '

' . sprintf($user->lang['RETURN_TOPIC'], '', ''); + $message = (($topic_data['bookmarked']) ? $user->lang['BOOKMARK_REMOVED'] : $user->lang['BOOKMARK_ADDED']); + + if (!$request->is_ajax()) + { + $message .= '

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

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

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