aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2014-01-17 18:08:19 -0800
committerNathan Guse <nathaniel.guse@gmail.com>2014-01-17 18:08:19 -0800
commit54afdeb7eeb460502559f6d0c0048c9e89647a8b (patch)
tree39b17059258259ba9651a000667fd895a15cfbd9 /phpBB
parent574eb2c199489eee4d21e0af0dd51dcb842bcc77 (diff)
parentf14ca6df6fb6051a20ca9a1b53463581ba0c32ea (diff)
downloadforums-54afdeb7eeb460502559f6d0c0048c9e89647a8b.tar
forums-54afdeb7eeb460502559f6d0c0048c9e89647a8b.tar.gz
forums-54afdeb7eeb460502559f6d0c0048c9e89647a8b.tar.bz2
forums-54afdeb7eeb460502559f6d0c0048c9e89647a8b.tar.xz
forums-54afdeb7eeb460502559f6d0c0048c9e89647a8b.zip
Merge pull request #1945 from VSEphpbb/ticket/12104
[ticket/12104] Replace shadow topics $sql with $sql_array for better Eve...
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/viewforum.php16
1 files changed, 11 insertions, 5 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 2c7a0a4829..9a229a0770 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -556,20 +556,26 @@ 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'
+ ),
+ '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 core.viewforum_get_shadowtopic_data
- * @var string sql The SQL string to get the data of any shadowtopics
+ * @var array sql_array SQL array 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))