mcdanielnc89 wrote:It sitll isn't working for me... i tried another computer as well..
For boards with a large, active userbase.. the Who Is Online page already has pagination to limit load times.. I think the pagination defaults to 25 users per page.. so it is only loading 25 avatar images per page..MrMontana wrote:Did you ever thought if there will be 200+ people on forum online at the same time, and it will take ages until it loads all avatars, info about the users..
Code: Select all
Parse error: syntax error, unexpected $end in /home/aikyam0/public_html/forum/viewonline.php on line 833
Code: Select all
$avatar_max_dimensions = $avatar_width = $avatar_height = '';
if ( !empty($row['user_avatar']) )
{
$avatar_max_dimensions = 30; // here you can change the max-width you would like to have the avatars displayed, change to 0 to use default
if ( $avatar_max_dimensions )
{
if ( $row['user_avatar_width'] >= $row['user_avatar_height'] )
{
$avatar_width = ( $row['user_avatar_width'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['user_avatar_width'] ;
$avatar_height = ( $avatar_width == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['user_avatar_width'] * $row['user_avatar_height']) : $row['user_avatar_height'] ;
}
else
{
$avatar_height = ( $row['user_avatar_height'] > $avatar_max_dimensions ) ? $avatar_max_dimensions : $row['user_avatar_height'] ;
$avatar_width = ( $avatar_height == $avatar_max_dimensions ) ? round($avatar_max_dimensions / $row['user_avatar_height'] * $row['user_avatar_width']) : $row['user_avatar_width'] ;
}
}
else
{
$avatar_height = $row['user_avatar_height'];
$avatar_width = $row['user_avatar_width'];
}
}
$template->assign_block_vars('user_row', array(
'USERNAME' => $row['username'],
'ONLINE_AVATAR' => ( $row['user_avatar'] ) ? get_user_avatar($row['user_avatar'], $row['user_avatar_type'], $avatar_width, $avatar_height) : '',
'USERNAME_COLOUR' => $row['user_colour'],
'USERNAME_FULL' => $username_full,
'USER_STAR' => $user_star,
'LASTUPDATE' => $user->format_date($row['session_time']),
'FORUM_LOCATION' => $location,
'USER_IP' => ($auth->acl_get('a_')) ? (($mode == 'lookup' && $session_id == $row['session_id']) ? gethostbyaddr($row['session_ip']) : $row['session_ip']) : '',
'USER_BROWSER' => ($auth->acl_get('a_user')) ? $row['session_browser'] : '',
'U_USER_PROFILE' => ($row['user_type'] != USER_IGNORE) ? get_username_string('profile', $row['user_id'], '') : '',
'U_USER_IP' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=lookup' . (($mode != 'lookup' || $row['session_id'] != $session_id) ? '&s=' . $row['session_id'] : '') . "&sg=$show_guests&start=$start&sk=$sort_key&sd=$sort_dir"),
'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']),
'U_FORUM_LOCATION' => $location_url,
'S_USER_HIDDEN' => $s_user_hidden,
'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false,
'S_USER_TYPE' => $row['user_type'],
));
}
$db->sql_freeresult($result);
unset($prev_id, $prev_ip);
// Generate reg/hidden/guest online text
$vars_online = array(
'REG' => array('logged_visible_online', 'l_r_user_s'),
'HIDDEN'=> array('logged_hidden_online', 'l_h_user_s'),
'GUEST' => array('guest_counter', 'l_g_user_s')
);
foreach ($vars_online as $l_prefix => $var_ary)
{
switch ($$var_ary[0])
{
case 0:
$$var_ary[1] = $user->lang[$l_prefix . '_USERS_ZERO_ONLINE'];
break;
case 1:
$$var_ary[1] = $user->lang[$l_prefix . '_USER_ONLINE'];
break;
default:
$$var_ary[1] = $user->lang[$l_prefix . '_USERS_ONLINE'];
break;
}
}
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);
// 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
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))
{
if ($row['group_name'] == 'BOTS')
{
$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
// Refreshing the page every 60 seconds...
meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start"));
// Send data to template
$template->assign_vars(array(
'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $logged_visible_online) . sprintf($l_h_user_s, $logged_hidden_online),
'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_counter),
'LEGEND' => $legend,
'PAGINATION' => $pagination,
'PAGE_NUMBER' => on_page($counter, $config['topics_per_page'], $start),
'U_SORT_USERNAME' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SORT_UPDATED' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SORT_LOCATION' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a') . '&sg=' . ((int) $show_guests)),
'U_SWITCH_GUEST_DISPLAY' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'sg=' . ((int) !$show_guests)),
'L_SWITCH_GUEST_DISPLAY' => ($show_guests) ? $user->lang['HIDE_GUESTS'] : $user->lang['DISPLAY_GUESTS'],
'S_SWITCH_GUEST_DISPLAY' => ($config['load_online_guests']) ? true : false)
);
// We do not need to load the who is online box here. ;)
$config['load_online'] = false;
// Output the page
page_header($user->lang['WHO_IS_ONLINE']);
$template->set_filenames(array(
'body' => 'viewonline_body.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>