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)
{
// Assign specific vars
$template->assign_vars(array(
'LEGEND' => $legend,
));
if (!isset($template->filename['whois_online_block']))
{
$template->set_filenames(array(
'whois_online_block' => 'portal/block/whois_online.html')
);
}
$block_temp = $template->assign_display('whois_online_block');
$template->assign_block_vars('portal_column_'.$block_pos, array(
'BLOCK_DATA' => $block_temp)
);
unset( $block_temp );
}
}
?>