Check the Usergroup.php page in the AdminCP to see how vBulletin does it.
I'm not sure if the count is stored in the usergroup cache, (run a var_dump() of $vbulletin->usergroupcache to see if it is present).
If it doesn't then you best bet is to run a query to count the users in each usergroup and run this on the usergroup.php page or as a scheduled task to update a cache in the datastore. (You don't want to be querying the database on every page load when the data is going to be fairly static).
I'll see if I can give you some more information later, when I boot up my dev vBulletin, but this should give you an idea of what to do/look for.
|