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:
| Parameter | Description | Type | Default |
|---|---|---|---|
| $onlinestats | Display the users online. | Boolean | true |
| $forumstats | Display the group, forum, topic, post stats. | Boolean | true |
| $memberstats | Display the member stats. | Boolean | true |
| $topstats | Display the top posters stats. | Boolean | true |
User specified styles available for template tag output is:
| Styles | Affected Output |
|---|---|
| .sfstatonline | Styles the <ul> element that wraps the online stats data. |
| .sfstatadmin | Styles the <li> element that wraps admin name. |
| .sfstatuser | Styles the <li> element that wraps user name. |
| .sfstatguest | Styles the <li> element that wraps guest label. |
| .sfstatmax | Styles the <li> element that wraps the maximum online. |
| .sfstatforums | Styles the <ul> element that wraps the forum stats data. |
| .sfstatforum | Styles the <li> element that wraps the forum stats label. |
| .sfstatgroup | Styles the <li> element that wraps the number of groups. |
| .sfstatforum | Styles the <li> element that wraps the number of forums. |
| .sfstattopic | Styles the <li> element that wraps the number of topics. |
| .sfstatpost | Styles the <li> element that wraps the number of posts. |
| .sfstatmembers | Styles the <ul> element that wraps the member stats. |
| .sfstatmembernum | Styles the <li> element that wraps the number of members. |
| .sfstatguestnum | Styles the <li> element that wraps the number of guests. |
| .sfstatadminnum | Styles the <li> element that wraps the number of admins. |
| .sfstattop | Styles the <ul> element that wraps the top poster stats. |
| .sfstattopname | Styles 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
