Hello guys, I'm trying to get most online and user online now.
For users online I tried $context['users_online'] but it's not working. However $context['common_stats']['total_topics'] seems to be working but context user online doesn't seem to work.
For most online today , $context['online_today'] doesn't seem to be working but comma_format($modSettings['mostOnlineToday']) works.
I don't get whats the problem with $context. For some its working and for some its not.
I have included SSI.php and $context, $settings, $txt, $scripturl, $modSettings as global.
Any help would be appreciated.
Heres a thread from a few days ago. You pretty much call a function that you can see in the example.
http://www.simplemachines.org/community/index.php?topic=420369.msg3840698#msg3840698
$membersOnlineOptions = array(
'show_hidden' => allowedTo('moderate_forum'),
'sort' => 'log_time',
'reverse_sort' => true,
);
$return = getMembersOnlineStats($membersOnlineOptions);
$onlinenow = count($return['list_users_online']);
I'm getting a value through this as 1. I'm not able to test it as I'm the only one user in my localhost. But is this correct way ?
If you want the number of user online, It looks good to me.