From 663220418e9ba925db62d835307af6595307222f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 9 Feb 2011 21:06:37 +0100 Subject: [ticket/9549] Enhance teampage and legend functionality PHPBB3-9549 --- phpBB/viewonline.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'phpBB/viewonline.php') 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&sk=$sort_key&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); -- cgit v1.2.1