acl_gets('a_group', 'a_groupadd', 'a_groupdel')) { $sql = 'SELECT group_id, group_name, group_colour, group_type FROM ' . GROUPS_TABLE . ' WHERE group_legend = 1 ORDER BY group_name ASC'; } else { $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type FROM ' . GROUPS_TABLE . ' g LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON ( g.group_id = ug.group_id AND ug.user_id = ' . $user->data['user_id'] . ' AND ug.user_pending = 0 ) WHERE g.group_legend = 1 AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ') ORDER BY g.group_name ASC'; } $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; if ($row['group_name'] == 'BOTS') { $legend .= (($legend != '') ? ', ' : '') . '' . $user->lang['G_BOTS'] . ''; } else { $legend .= (($legend != '') ? ', ' : '') . '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } } $db->sql_freeresult($result); // // users online list borrowed from includes/functions.php (phpBB-3.0.B3) // if this gets changed (in functions.php) and I don't notice it, please tell me) // $display_online_list = true; // Get users online list ... if required $l_online_users = $online_userlist = $l_online_record = ''; if ($config['load_online'] && $config['load_online_time'] && $display_online_list) { $portal_whois_show = true; } else { $portal_whois_show = false; } // Assign specific vars $template->assign_vars(array( 'S_DISPLAY_ONLINE_PORTAL_LIST' => $portal_whois_show, 'LEGEND' => $legend, )); ?>