Skip to the content
Documentation

anonymous_count

No ratings yet

Summary

Fetches the number of anonymous users.

Usage

fetch( 'user', 'anonymous_count' )

Returns

The number of anonymous users as an integer.

Description

This function counts the number of anonymous users currently accessing the site and returns that count (as an integer). An anonymous user is considered to be active if the last access time 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 $visitors=fetch( 'user', 'anonymous_count' )}
There are {$visitors} anonymous users accessing the site.

Outputs the number of anonymous users that are currently accessing the site.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.