Home  ›  Template Tags  ›  Stats Template Tags

Stats Template Tags

The following template tags are used to output forum statistics.

Before using any of these template tags, go to Forum ☛ Configuration ☛ Code and Query Optimisation and turn on the support for ‘Stats’ Template tags

Forum Statistics

This template tag can be used to display the forum statistics normally located in the forum footer in other locations.

sf_stats_tag($onlinestats=true, $forumstats=true, $memberstats=true, $topstats=true);

Possible arguments to the template tag are:

ParameterDescriptionTypeDefault
$onlinestatsDisplay the users online.Booleantrue
$forumstatsDisplay the group, forum, topic, post stats.Booleantrue
$memberstatsDisplay the member stats.Booleantrue
$topstatsDisplay the top posters stats.Booleantrue

User specified styles available for template tag output is:

StylesAffected Output
.sfstatonline Styles the <ul> element that wraps the online stats data.
.sfstatadminStyles the <li> element that wraps admin name.
.sfstatuserStyles the <li> element that wraps user name.
.sfstatguestStyles the <li> element that wraps guest label.
.sfstatmaxStyles the <li> element that wraps the maximum online.
.sfstatforumsStyles the <ul> element that wraps the forum stats data.
.sfstatforumStyles the <li> element that wraps the forum stats label.
.sfstatgroupStyles the <li> element that wraps the number of groups.
.sfstatforumStyles the <li> element that wraps the number of forums.
.sfstattopicStyles the <li> element that wraps the number of topics.
.sfstatpostStyles the <li> element that wraps the number of posts.
.sfstatmembersStyles the <ul> element that wraps the member stats.
.sfstatmembernumStyles the <li> element that wraps the number of members.
.sfstatguestnumStyles the <li> element that wraps the number of guests.
.sfstatadminnumStyles the <li> element that wraps the number of admins.
.sfstattopStyles the <ul> element that wraps the top poster stats.
.sfstattopnameStyles the <li> element that wraps the top poster name.

An example usage of the template tag is:

<?php sf_stats_tag(true, true, true, true); ?>

Article written by steve on January 24, 2010 and last modified by Yellow Swordfish on February 26, 2010