aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewonline.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2015-04-09 22:53:15 +0700
committerrxu <rxu@mail.ru>2015-04-09 23:20:07 +0700
commitb0f5ef0b1a39a587cf00c4f4e4cba66c81202351 (patch)
treea67b815d31d92545dab9fe67311292c6ef7d79a0 /phpBB/viewonline.php
parent17620bba46138ec48a6748a4147986b1d21a48fd (diff)
downloadforums-b0f5ef0b1a39a587cf00c4f4e4cba66c81202351.tar
forums-b0f5ef0b1a39a587cf00c4f4e4cba66c81202351.tar.gz
forums-b0f5ef0b1a39a587cf00c4f4e4cba66c81202351.tar.bz2
forums-b0f5ef0b1a39a587cf00c4f4e4cba66c81202351.tar.xz
forums-b0f5ef0b1a39a587cf00c4f4e4cba66c81202351.zip
[ticket/13752] Add viewonline.php core event to allow modifying forum data SQL
PHPBB3-13752
Diffstat (limited to 'phpBB/viewonline.php')
-rw-r--r--phpBB/viewonline.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 9589fb54e2..583e297682 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -86,10 +86,26 @@ if ($mode == 'whois' && $auth->acl_get('a_') && $session_id)
}
// Forum info
-$sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
- FROM ' . FORUMS_TABLE . '
- ORDER BY left_id ASC';
-$result = $db->sql_query($sql, 600);
+$sql_ary = array(
+ 'SELECT' => 'f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.left_id, f.right_id',
+ 'FROM' => array(
+ FORUMS_TABLE => 'f',
+ ),
+ 'ORDER_BY' => 'f.left_id ASC',
+);
+
+/**
+* Modify the forum data SQL query for getting additional fields if needed
+*
+* @event core.viewonline_modify_forum_data_sql
+* @var array sql_ary The SQL array
+* @since 3.1.5-RC1
+*/
+$vars = array('sql_ary');
+extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_forum_data_sql', compact($vars)));
+
+$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary), 600);
+unset($sql_ary);
$forum_data = array();
while ($row = $db->sql_fetchrow($result))