mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/11749] PHP Events for search.php
PHPBB3-11749
This commit is contained in:
parent
26dac64d45
commit
9e68404de5
1 changed files with 23 additions and 0 deletions
|
@ -687,6 +687,18 @@ if ($keywords || $author || $author_id || $search_id || $submit)
|
||||||
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
|
$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
|
$sql = "SELECT $sql_select
|
||||||
FROM $sql_from
|
FROM $sql_from
|
||||||
WHERE $sql_where";
|
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(
|
$template->assign_block_vars('searchresults', array_merge($tpl_ary, array(
|
||||||
'FORUM_ID' => $forum_id,
|
'FORUM_ID' => $forum_id,
|
||||||
'TOPIC_ID' => $result_topic_id,
|
'TOPIC_ID' => $result_topic_id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue