diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 927e72010e..ba3d5b58f7 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -319,6 +319,7 @@ class acp_board 'load_online_guests' => array('lang' => 'YES_ONLINE_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'load_onlinetrack' => array('lang' => 'YES_ONLINE_TRACK', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'load_birthdays' => array('lang' => 'YES_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'load_unreads_search' => array('lang' => 'YES_UNREADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_moderators' => array('lang' => 'YES_MODERATORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c4ff998e69..efa835574d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4465,6 +4465,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_ENABLE_FEEDS_TOPICS_ACTIVE' => ($config['feed_topics_active']) ? true : false, 'S_ENABLE_FEEDS_NEWS' => ($s_feed_news) ? true : false, + 'S_LOAD_UNREADS' => ($config['load_unreads_search']) ? true : false, + 'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template', 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index ac0ddf1b73..9fb02f629f 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -375,6 +375,7 @@ $lang = array_merge($lang, array( 'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.', 'YES_READ_MARKING' => 'Enable server-side topic marking', 'YES_READ_MARKING_EXPLAIN' => 'Stores read/unread status information in the database rather than a cookie.', + 'YES_UNREADS' => 'Enable search of unread posts', )); // Auth settings diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index be92391a4e..67b21edba8 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -62,6 +62,7 @@ $lang = array_merge($lang, array( 'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.', 'NO_SEARCH_RESULTS' => 'No suitable matches were found.', 'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.', + 'NO_SEARCH_UNREADS' => 'Sorry but search for unread posts is not permitted.', 'WORD_IN_NO_POST' => 'No posts were found because the word %s is not contained in any post.', 'WORDS_IN_NO_POST' => 'No posts were found because the words %s are not contained in any post.', 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? diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index 17790eb78a..af2077141c 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -6,7 +6,7 @@ diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 963f5160dd..37691d4f1c 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -202,7 +202,7 @@ function marklist(id, name, state)