Resource icon

Global Template Usergroup Member Count 1.0.0

No permission to download

Liam W

in memoriam 1998-2020
Liam W submitted a new resource:

Global Template Usergroup Member Count - Access the counts of members in usergroups for use in templates.

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.

Please see the FAQ to see how to use the variable.

Read more about this resource...


Well-known member
Just wanted to add, works better than I even thought it could. Could have just been a random block, but instead you gave users the ultimate control.

Great work.



I tried adding the variable to page_container but didint show a thing o_O also i get this error when i tried to install it on my localhost:
Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Deadlock found when trying to get lock; try restarting transaction - library/Zend/Db/Statement/Mysqli.php:214
Generated By: theraptor, 1 minute ago
Stack Trace
#0 /opt/lampp/htdocs/xenforo/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /opt/lampp/htdocs/xenforo/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /opt/lampp/htdocs/xenforo/library/XenForo/Model/Phrase.php(1188): Zend_Db_Adapter_Abstract->query('????DELETE FROM...', 'liam_usergroupm...')
#3 /opt/lampp/htdocs/xenforo/library/XenForo/Model/Phrase.php(1222): XenForo_Model_Phrase->deletePhrasesForAddOn('liam_usergroupm...')
#4 /opt/lampp/htdocs/xenforo/library/XenForo/Model/AddOn.php(328): XenForo_Model_Phrase->importPhrasesAddOnXml(Object(SimpleXMLElement), 'liam_usergroupm...')
#5 /opt/lampp/htdocs/xenforo/library/*******/Credits/Model/AddOn.php(14): XenForo_Model_AddOn->importAddOnExtraDataFromXml(Object(SimpleXMLElement), 'liam_usergroupm...')
#6 /opt/lampp/htdocs/xenforo/library/XenForo/Model/AddOn.php(226): *******_Credits_Model_AddOn->importAddOnExtraDataFromXml(Object(SimpleXMLElement), 'liam_usergroupm...')
#7 /opt/lampp/htdocs/xenforo/library/XenForo/Model/AddOn.php(169): XenForo_Model_AddOn->installAddOnXml(Object(SimpleXMLElement), false)
#8 /opt/lampp/htdocs/xenforo/library/XenForo/ControllerAdmin/AddOn.php(187): XenForo_Model_AddOn->installAddOnXmlFromFile('/opt/lampp/temp...')
#9 /opt/lampp/htdocs/xenforo/library/XenForo/FrontController.php(347): XenForo_ControllerAdmin_AddOn->actionInstall()
#10 /opt/lampp/htdocs/xenforo/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#11 /opt/lampp/htdocs/xenforo/admin.php(13): XenForo_FrontController->run()
#12 {main}
Request State
array(3) {
  ["url"] => string(50) "http://localhost/xenforo/admin.php?add-ons/install"
  ["_GET"] => array(1) {
    ["add-ons/install"] => string(0) ""
  ["_POST"] => array(3) {
    ["server_file"] => string(0) ""
    ["_xfConfirm"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
Last edited:

Liam W

in memoriam 1998-2020
Now the thing is whenever i try the variable nothing appear for example if i do {$userGroupMembers.4} it print nothing while the id 4 reffer to the moderating usergroup.

Go into the cron page and run the cron for this addon.

The values probably haven't been updated.