diff options
Diffstat (limited to 'phpBB/search.php')
-rw-r--r-- | phpBB/search.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index cf2e8615c2..5e2a7c2836 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -155,7 +155,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : ""; - $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id + $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id FROM ' . FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id AND fa.session_id = '" . $db->sql_escape($user->session_id) . "') @@ -173,6 +173,13 @@ if ($keywords || $author || $author_id || $search_id || $submit) continue; } + // Exclude forums from active topics + if (!($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && ($search_id == 'active_topics')) + { + $ex_fid_ary[] = (int) $row['forum_id']; + continue; + } + if (sizeof($search_forum)) { if ($search_child) @@ -308,7 +315,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) $last_post_time = ''; } - if ($sort_key == 'a') { $sort_join = USERS_TABLE . ' u, '; @@ -945,7 +951,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) page_footer(); } - // Search forum $s_forums = ''; $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id, f.forum_password, f.enable_indexing, fa.user_id |