aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/search.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2010-05-17 22:50:03 +0800
committerAndreas Fischer <bantu@phpbb.com>2010-08-29 16:09:09 +0200
commitf1d50057975695137d44f5f4b4c035e70d878657 (patch)
tree2976dd4bc9f52434a71175ce321ae1c4ac54edc9 /phpBB/search.php
parentdbe8fb6488005c3295f839c7302a56f1de872426 (diff)
downloadforums-f1d50057975695137d44f5f4b4c035e70d878657.tar
forums-f1d50057975695137d44f5f4b4c035e70d878657.tar.gz
forums-f1d50057975695137d44f5f4b4c035e70d878657.tar.bz2
forums-f1d50057975695137d44f5f4b4c035e70d878657.tar.xz
forums-f1d50057975695137d44f5f4b4c035e70d878657.zip
[ticket/9613] Implement a load switch for unread posts search feature.
Since unread posts search can produce a high server load in certain circumstances, we implement a switch for ACP "Load settings" to have an option to disable this type of search. PHPBB3-9613
Diffstat (limited to 'phpBB/search.php')
-rw-r--r--phpBB/search.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/search.php b/phpBB/search.php
index 1e1e42d01f..9952f5c744 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -61,10 +61,18 @@ if ($search_id == 'egosearch')
}
}
-// Search for unread posts needs user to be logged in if topics tracking for guests is disabled
-if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
+// Search for unread posts needs to be allowed and user to be logged in if topics tracking for guests is disabled
+if ($search_id == 'unreadposts')
{
- login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+ if (!$config['load_unreads_search'])
+ {
+ $template->assign_var('S_NO_SEARCH', true);
+ trigger_error('NO_SEARCH_UNREADS');
+ }
+ else if (!$config['load_anon_lastread'] && !$user->data['is_registered'])
+ {
+ login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
+ }
}
// Is user able to search? Has search been disabled?