HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

ReusableStats 0.2.3

Expose additiona smarty tag to get forum stats. Moreover add a special url to provide this data in json (enabled via configuration). Provide additional stats if you are using WhoisOnline plugin.

ReusableStats plugin for Vanilla Forums

Expose new smarty tags to get forum stats. Moreover add a special url to provide these data in json (enabled via configuration).

Howto use in your theme tpl files

Threads: {$threads} 
Posts: {$posts} total posts count
Members: {$members} total members count
RoleMembers: {$role_members.ROLE_NAME} (case sensitive) total count of users in a role
RoleMembersOnline: {$role_members_online.ROLE_NAME} (case sensitive) total count of users in a role that are online (Requires WhoisOnline pluigin)

Using in theme's php files

<?php echo $this->Data['threads']; ?>
<?php echo $this->Data['posts']; ?>
<?php echo $this->Data['members']; ?>
<?php echo $this->Data['role_members']['ROLE_NAME']; ?>
<?php echo $this->Data['role_members_online']['ROLE_NAME']; ?>

Stats via Json

If enabled (via plugin's settings page), a special url http://example.com/forum/jsonstat is exposed to provide these stats in json format (e.g. grab them with jquery to show forum stats on your blog header...).

Compatibility

Requires Vanilla >= 2.0.

Sponsor

Thanks to johnnyzen for making this happen.

Github repository

Commits are welcome https://github.com/lifeisfoo/ReusableStats

Author and License

Alessandro Miliucci, GPL v3 Icon by Valera Zvonko under Creative Commons (Attribution 3.0 Unported).

Questions