mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 23:16:13 +02:00
[ticket/12104] Replace shadow topics $sql with $sql_array for better Event handling
PHPBB3-12104
This commit is contained in:
parent
3e84fb76a3
commit
f9cef15989
@ -556,9 +556,16 @@ if (sizeof($topic_list))
|
|||||||
// If we have some shadow topics, update the rowset to reflect their topic information
|
// If we have some shadow topics, update the rowset to reflect their topic information
|
||||||
if (sizeof($shadow_topic_list))
|
if (sizeof($shadow_topic_list))
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
// SQL array for obtaining shadow topics
|
||||||
FROM ' . TOPICS_TABLE . '
|
$sql_array = array(
|
||||||
WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
|
'SELECT' => 't.*',
|
||||||
|
'FROM' => array(
|
||||||
|
TOPICS_TABLE => 't'
|
||||||
|
),
|
||||||
|
'LEFT_JOIN' => array(),
|
||||||
|
|
||||||
|
'WHERE' => $db->sql_in_set('t.topic_id', array_keys($shadow_topic_list)),
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event to modify the SQL query before the shadowtopic data is retrieved
|
* Event to modify the SQL query before the shadowtopic data is retrieved
|
||||||
@ -567,9 +574,10 @@ if (sizeof($shadow_topic_list))
|
|||||||
* @var string sql The SQL string to get the data of any shadowtopics
|
* @var string sql The SQL string to get the data of any shadowtopics
|
||||||
* @since 3.1-A1
|
* @since 3.1-A1
|
||||||
*/
|
*/
|
||||||
$vars = array('sql');
|
$vars = array('sql_array');
|
||||||
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
|
||||||
|
|
||||||
|
$sql = $db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user