From a57c81481d21433bdb185accfd7f2b82858ba461 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 12 Dec 2012 18:38:17 +0100 Subject: [ticket/10954] Mark topics read without popup Also added missing handling of locked forums. PHPBB3-10954 --- phpBB/viewforum.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'phpBB/viewforum.php') diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 83e5d4caa5..1b84c5f52f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -181,7 +181,20 @@ if ($mark_read == 'topics') $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); meta_refresh(3, $redirect_url); - trigger_error($user->lang['TOPICS_MARKED'] . '

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

' . sprintf($user->lang['RETURN_FORUM'], '', '')); + } + else + { + // Tell the ajax script what language vars need to be replaced + $data = array( + 'NO_UNREAD_POSTS' => $user->lang['NO_UNREAD_POSTS'], + 'UNREAD_POSTS' => $user->lang['UNREAD_POSTS'] + ); + $json_response = new phpbb_json_response(); + $json_response->send($data); + } } // Is a forum specific topic count required? -- cgit v1.2.1