mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-13 04:04:12 +02:00
[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
This commit is contained in:
@@ -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?
|
||||
|
Reference in New Issue
Block a user