Skip to content

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

Notifications You must be signed in to change notification settings

vanillaforums-plugins/ReusableStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reusable Stats plugin for Vanilla Forums

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

Requires Vanilla >= 2.0.18

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)
TotalViews: {$total_views}

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']; ?>
<?php echo $this->Data['total_views']; ?>

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...).

Sponsor

Thanks to johnnyzen for making this happen.

##Author and License Alessandro Miliucci, GPL v3, Icon by Webdesigner Depot

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages