Page 1 of 1

How to get number of users online?

Posted: Sun Jun 09, 2024 8:12 am
by Refugees
I need to have number of users online for statistics block in my index_body template, only the number not the whole string which is {{ TOTAL_USERS }} How can this be done?
Open ./language/en/common.php and find:

Code: Select all

	// "... :: x registered, y hidden and z guests"
	'ONLINE_USERS_TOTAL_GUESTS'	=> array(
		1	=> 'In total there is <strong>%1$d</strong> user online :: %2$s, %3$s and %4$s',
		2	=> 'In total there are <strong>%1$d</strong> users online :: %2$s, %3$s and %4$s',
	),
	
Replace by:

Code: Select all

	// "... :: x registered, y hidden and z guests"
	'ONLINE_USERS_TOTAL_GUESTS'	=> array(
		1	=> 'User online <strong title="%2$s, %3$s and %4$s">%1$d</strong>',
		2	=> 'Users online <strong title="%2$s, %3$s and %4$s">%1$d</strong>',
	),
After modifications clear cache.

before_mod.png
before_mod.png (19.9 KiB) Viewed 24 times
after_mod.png
after_mod.png (22.86 KiB) Viewed 24 times