1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-31 13:48:04 +01:00

[ticket/11749] PHP Events for search.php

PHPBB3-11749
This commit is contained in:
Matt Friedman 2013-07-27 10:44:39 -07:00
parent 26dac64d45
commit 9e68404de5

View File

@ -687,6 +687,18 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
/**
* Event to modify the SQL query before the topic data is retrieved
*
* @event core.search_get_topic_data
* @var string sql_select The SQL SELECT string used by search to get topic data
* @var string sql_from The SQL FROM string used by search to get topic data
* @var string sql_where The SQL WHERE string used by search to get topic data
* @since 3.1-A1
*/
$vars = array('sql_select', 'sql_from', 'sql_where');
extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
$sql = "SELECT $sql_select
FROM $sql_from
WHERE $sql_where";
@ -989,6 +1001,17 @@ if ($keywords || $author || $author_id || $search_id || $submit)
);
}
/**
* Modify the topic data before it is assigned to the template
*
* @event core.search_modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
* @since 3.1-A1
*/
$vars = array('row', 'tpl_ary');
extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
$template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $result_topic_id,