Skip to the content
Documentation

logged_in_count

No ratings yet

Summary

Fetches the number of users that are logged in.

Usage

fetch( 'user', 'logged_in_count' )

Returns

The number of logged in users (as an integer).

Description

This function counts the number of logged in users (both anonymous and non-anonymous) and returns that count as an integer. A user is considered to be active / logged in if the last access time is within the range of the activity timeout. The timeout can be set using the "ActivityTimeout" directive in a configuration override for "site.ini". The default timeout is one hour.

Examples

Example 1

{def $users=fetch( 'user', 'logged_in_count' )}
There are currently {$users} active users on the system.

Outputs the number of currently active / logged in users.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.