Welcome to Our Community

Registration on our forums are now open for some days! Feel free to sign up today.

Global Template Usergroup Member Count 1.0.0

Access the counts of members in usergroups for use in templates.

  1. XenForo Rocks
    Compatible XF Versions:
    • 1.2
    • 1.3
    • 1.4
    Additional Requirements:
    PHP 5.3+
    Visible Branding:
    No
    This is a simple addon that adds a variable to every template, which contains the amount of members in usergroups.

    The data for this variable is fetched from the XenForo SimpleCache, which is updated by a cron that runs (by default) every 6 hours.

    The variable is 'userGroupMembers'. It is an array - the key is the usergroup ID, and the value is the number of members in that usergroup.

    You can print out the value to the screen by using a line like this in a template:

    Code:
    {$userGroupMembers.3}
    
    That line would print the number of members in the usergroup with ID 3 (the administrator default usergroup).