Avatars in Who is Online

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL

Re: Avatars in Who is Online

Post by lefty74 »

mcdanielnc89 wrote:It sitll isn't working for me... i tried another computer as well..
Image
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
mcdanielnc89
Registered User
Posts: 703
Joined: Tue Feb 06, 2007 10:49 pm

Re: Avatars in Who is Online

Post by mcdanielnc89 »

User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL

Re: Avatars in Who is Online

Post by lefty74 »

i cant see an avatar on your profile, maybe thats why?
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
mcdanielnc89
Registered User
Posts: 703
Joined: Tue Feb 06, 2007 10:49 pm

Re: Avatars in Who is Online

Post by mcdanielnc89 »

Bah! It was just on there . Stupid thing. LOl.. letme go see.
User avatar
mcdanielnc89
Registered User
Posts: 703
Joined: Tue Feb 06, 2007 10:49 pm

Re: Avatars in Who is Online

Post by mcdanielnc89 »

That'd be why.. So sorry lefty, haha..
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL

Re: Avatars in Who is Online

Post by lefty74 »

no problem, glad it's working for you now.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
thezerocool
Registered User
Posts: 4
Joined: Sun Aug 24, 2008 1:53 pm

Re: Avatars in Who is Online

Post by thezerocool »

is there a mod similar to this for v 2 forums?
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL

Re: Avatars in Who is Online

Post by lefty74 »

yes, i am sure there is, i dont have a link handy atm but if you search for avatar in the mod db, i am certain one of them will be it.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
MrMontana
Registered User
Posts: 86
Joined: Wed Sep 03, 2008 7:14 am

Re: Avatars in Who is Online

Post by MrMontana »

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..
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL

Re: Avatars in Who is Online

Post by lefty74 »

No, I didn't but if that is an issue for people, they would not install it in the first place.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
DuskWo1f
Registered User
Posts: 4
Joined: Thu Oct 23, 2008 9:42 pm

Re: Avatars in Who is Online

Post by DuskWo1f »

Thanks for the mod works great. :D
User avatar
Diet Ebola Cola
Registered User
Posts: 132
Joined: Fri Oct 03, 2008 3:57 am
Location: USA

Re: Avatars in Who is Online

Post by Diet Ebola Cola »

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..
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..

It would usually only take awhile to load if you allow users to use avatars from other websites..

I don't think this Mod displays avatars for those listed under Who Is Online text displayed in the board index and when viewing topics (users browsing this forum).. you might have been thinking that it did.. if it did that then load time would be a major concern.. and some limits would need to be in place to prevent that..
Diet Ebola Cola
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

Re: Avatars in Who is Online

Post by shahinavthal »

I am back to disturb you more :D

I tried this out but when i click on who is online i get the following error

Code: Select all

Parse error: syntax error, unexpected $end in /home/aikyam0/public_html/forum/viewonline.php on line 833
This is the code from line 697 of viewonline.php till the end..

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();
?>
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

Re: Avatars in Who is Online

Post by shahinavthal »

^^^ Oopsie...My error...fixed it :oops:
Richazey
Registered User
Posts: 823
Joined: Mon Oct 27, 2008 9:03 pm

Re: Avatars in Who is Online

Post by Richazey »

Nice mod added it earlier :D

Return to “[3.0.x] MOD Database Releases”