As per https://area51.phpbb.com/phpBB/viewtopic.php?f=111&t=45383
Identifer: core.viewforum_get_topic_id_sql
Location: viewforum.php
Parameters: sql_array
Explanation:
Currently there is no way to restrict which topics get shows on a forums page. It is possible to join with another table to retrieve additional details, but restricting based on that join isn't possible.
Around line 510, it involves converting the sql from a string to an array like so:
$sql_array = array(
|
'SELECT' => 't.topic_id',
|
'FROM' => array(TOPICS_TABLE => 't'),
|
'WHERE' => $sql_where
|
. " AND t.topic_type IN (" . POST_NORMAL . ', ' . POST_STICKY . ")
|
$sql_approved
|
$sql_limit_time",
|
'ORDER_BY' => "t.topic_type " . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order);
|
Then triggering the event:
$vars = array('sql_array');
|
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_id_sql', compact($vars)));
|
$sql = $db->sql_build_query('SELECT', $sql_array);
|