aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorMatt Friedman <maf675@gmail.com>2014-01-09 12:43:33 -0800
committerMatt Friedman <maf675@gmail.com>2014-01-09 12:43:33 -0800
commitf9cef159897624360bc24f1162ae17bf29ae9659 (patch)
treecd0fdf3e9f38aa13d524f6fcbd874a6edeea7d49 /phpBB/viewforum.php
parent3e84fb76a3639dce2becb7ae620423a5cfdccecb (diff)
downloadforums-f9cef159897624360bc24f1162ae17bf29ae9659.tar
forums-f9cef159897624360bc24f1162ae17bf29ae9659.tar.gz
forums-f9cef159897624360bc24f1162ae17bf29ae9659.tar.bz2
forums-f9cef159897624360bc24f1162ae17bf29ae9659.tar.xz
forums-f9cef159897624360bc24f1162ae17bf29ae9659.zip
[ticket/12104] Replace shadow topics $sql with $sql_array for better Event handling
PHPBB3-12104
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 2c7a0a4829..587cb90a23 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -556,9 +556,16 @@ if (sizeof($topic_list))
// If we have some shadow topics, update the rowset to reflect their topic information
if (sizeof($shadow_topic_list))
{
- $sql = 'SELECT *
- FROM ' . TOPICS_TABLE . '
- WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
+ // SQL array for obtaining shadow topics
+ $sql_array = array(
+ '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
@@ -567,9 +574,10 @@ if (sizeof($shadow_topic_list))
* @var string sql The SQL string to get the data of any shadowtopics
* @since 3.1-A1
*/
- $vars = array('sql');
+ $vars = array('sql_array');
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);
while ($row = $db->sql_fetchrow($result))