diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index cf447ee7c6..b9d8127742 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -111,6 +111,7 @@
[Fix] Fix Oracle database backup (Bug #46715)
[Fix] Update attachments table when deleting user and retaining his posts. (Bug #40245 - Patch by rxu)
[Fix] Template cache error for files of template-subfolders (Bug #46145 - Patch by nickvergessen)
+ [Fix] Exclude forum from active topics option is ignored (Bug #19135 - Patch by nickvergessen)
[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
[Change] Template engine now permits to a limited extent variable includes.
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