diff options
author | rxu <rxu@mail.ru> | 2016-07-17 11:56:40 +0700 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2016-07-17 12:09:15 +0700 |
commit | 51952005eba708ff228061b8e14c0b4a23e1db7e (patch) | |
tree | 2cd56dc661e624ee8a3aab7072359ca45032a028 /phpBB/search.php | |
parent | b54aa81cdd4e55daf9537c9dde93d4fc9d1396be (diff) | |
download | forums-51952005eba708ff228061b8e14c0b4a23e1db7e.tar forums-51952005eba708ff228061b8e14c0b4a23e1db7e.tar.gz forums-51952005eba708ff228061b8e14c0b4a23e1db7e.tar.bz2 forums-51952005eba708ff228061b8e14c0b4a23e1db7e.tar.xz forums-51952005eba708ff228061b8e14c0b4a23e1db7e.zip |
[ticket/14712] Add search core event to allow modifying the forum select list
PHPBB3-14712
Diffstat (limited to 'phpBB/search.php')
-rw-r--r-- | phpBB/search.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/phpBB/search.php b/phpBB/search.php index 3fa3b61c3c..a0380590c1 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1254,6 +1254,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // Search forum +$rowset = array(); $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 FROM ' . FORUMS_TABLE . ' f @@ -1262,11 +1263,27 @@ $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f ORDER BY f.left_id ASC"; $result = $db->sql_query($sql); +while ($row = $db->sql_fetchrow($result)) +{ + $rowset[(int) $row['forum_id']] = $row; +} +$db->sql_freeresult($result); + $right = $cat_right = $padding_inc = 0; $padding = $forum_list = $holding = ''; $pad_store = array('0' => ''); -while ($row = $db->sql_fetchrow($result)) +/** +* Modify the forum select list for advanced search page +* +* @event core.search_modify_forum_select_list +* @var array rowset Array with the forums list data +* @since 3.1.10-RC1 +*/ +$vars = array('rowset'); +extract($phpbb_dispatcher->trigger_event('core.search_modify_forum_select_list', compact($vars))); + +foreach ($rowset as $row) { if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) { @@ -1338,8 +1355,8 @@ if ($holding) $s_forums .= $holding; } -$db->sql_freeresult($result); unset($pad_store); +unset($rowset); if (!$s_forums) { |