https://www.icyphoenix.com/viewtopic.php?f=35&t=7939&p=53205#p53205
-----------------------------------
Mighty Gorgon
Tue 19 Jul, 2011 22:24

Re: Number Of Online Users In Chat In The Top Menu
-----------------------------------
Try to have a look at the beginning of this file: [b]includes/users_online_block.php[/b]

[codeblock]if (defined('SHOW_ONLINE_CHAT') && $board_config['show_chat_online'])
{
	//$template->assign_block_vars('switch_ac_online', array());
	include_once(IP_ROOT_PATH . 'includes/functions_ajax_chat.' . PHP_EXT);
	$sql = "SELECT u.user_id, u.username, u.user_active, u.user_color, u.user_level
	FROM " . AJAX_SHOUTBOX_SESSIONS_TABLE . " s, " . USERS_TABLE . " u
	WHERE s.session_time >= " . (time() - SESSION_REFRESH) . "
	AND s.session_user_id = u.user_id
	ORDER BY case user_level when 0 then 10 else user_level end";
	$result = $db->sql_query($sql);

	// Set all counters to 0
	$ac_reg_online_counter = $ac_guest_online_counter = $ac_online_counter = 0;
	$ac_username_lists = '';
	while($ac_online = $db->sql_fetchrow($result))
	{
		if($ac_online['user_id'] != ANONYMOUS)
		{
			$ac_username_lists .= (($ac_username_lists == '') ? '' : ', ') . colorize_username($ac_online['user_id'], $ac_online['username'], $ac_online['user_color'], $ac_online['user_active']);
			$ac_reg_online_counter++;
		}
		else
		{
			$ac_guest_online_counter++;
		}
		$ac_online_counter++;
	}
	$ac_username_lists = ($ac_username_lists == '') ? '' : ('[ ' . $ac_username_lists . ' ]');

	$ac_t_user = ($ac_online_counter == 0) ? $lang['AC_Online_users_zero_total'] : (($ac_online_counter == 1) ? $lang['AC_Online_user_total'] : (sprintf($lang['AC_Online_users_total'], $ac_online_counter)));
	$ac_r_user = ($ac_reg_online_counter == 0) ? $lang['Reg_users_zero_total'] : (($ac_reg_online_counter == 1) ? (sprintf($lang['Reg_user_total'], $ac_reg_online_counter)) : (sprintf($lang['Reg_users_total'], $ac_reg_online_counter)));
	$ac_g_user = ($ac_guest_online_counter == 0) ? $lang['Guest_users_zero_total'] : (($ac_guest_online_counter == 0) ? (sprintf($lang['Guest_user_total'], $ac_guest_online_counter)) : (sprintf($lang['Guest_users_total'], $ac_guest_online_counter)));
	$ac_online_text = $ac_t_user . $ac_r_user . $ac_g_user;
}[/codeblock]

Plus something like this:
[codeblock]			'AC_LIST_TEXT' => $ac_online_text,
			'AC_LIST' => $ac_username_lists,[/codeblock]

I'll let you discover where you have to put the code...  :mricy:


