aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewonline.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-02-09 21:06:37 +0100
committerJoas Schilling <nickvergessen@gmx.de>2011-02-16 18:21:49 +0100
commit663220418e9ba925db62d835307af6595307222f (patch)
tree0bd73da006bdb8e44ce98046bbfbb787f798c4e5 /phpBB/viewonline.php
parent4f2b0d9d42869d743a04e6e2b2541383ffeff16c (diff)
downloadforums-663220418e9ba925db62d835307af6595307222f.tar
forums-663220418e9ba925db62d835307af6595307222f.tar.gz
forums-663220418e9ba925db62d835307af6595307222f.tar.bz2
forums-663220418e9ba925db62d835307af6595307222f.tar.xz
forums-663220418e9ba925db62d835307af6595307222f.zip
[ticket/9549] Enhance teampage and legend functionality
PHPBB3-9549
Diffstat (limited to 'phpBB/viewonline.php')
-rw-r--r--phpBB/viewonline.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index ff4e018d12..74ad7eba0d 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -371,17 +371,18 @@ unset($vars_online);
$pagination = generate_pagination(append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir"), $counter, $config['topics_per_page'], $start);
+$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
- $sql = 'SELECT group_id, group_name, group_colour, group_type
+ $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
FROM ' . GROUPS_TABLE . '
- WHERE group_legend = 1
- ORDER BY group_name ASC';
+ WHERE group_legend = > 0
+ ORDER BY ' . $order_legend . ' ASC';
}
else
{
- $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
+ $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
@@ -389,9 +390,9 @@ else
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
- WHERE g.group_legend = 1
+ WHERE g.group_legend > 0
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
- ORDER BY g.group_name ASC';
+ ORDER BY g.' . $order_legend . ' ASC';
}
$result = $db->sql_query($sql);