Start of pallet

This commit is contained in:
Ice
2008-09-28 22:59:25 +00:00
parent b4c27b2f0d
commit b800ee0c96
41 changed files with 1190 additions and 854 deletions

View File

@@ -20,73 +20,84 @@ if (!defined('IN_PORTAL'))
exit;
}
//
// who is online borrowed from index.php (phpBB-3.0.B3)
// if this gets changed (in index.php) and I don't notice it, please tell me)
//
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
if ($config['load_online'] && $config['load_online_time'])
{
$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);
// who is online borrowed from index.php (phpBB-3.0.B3)
// if this gets changed (in index.php) and I don't notice it, please tell me)
//
$legend = '';
while ($row = $db->sql_fetchrow($result))
{
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
if ($row['group_name'] == 'BOTS')
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
$legend .= (($legend != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
$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 != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$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 );
}
}
$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,
));
?>