• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest User group admin - # of users in group in mouseover

MGSteve

Well-known member
#1
As subject really, would be really cool if you could see how many users were in a particular group when the mouse is hovering over the usergroup name.

for some reason I've got duplicated user groups and I can't tell which have users in them and which don't!
 

Jake Bunce

XenForo moderator
Staff member
#2
Here is a query you can run to show the number of users in each group:

Code:
SELECT ug.title, ug.user_group_id, COUNT(*) AS numUsers
FROM xf_user_group_relation AS ugr
LEFT JOIN xf_user_group AS ug ON (ug.user_group_id = ugr.user_group_id)
GROUP BY ugr.user_group_id
This will return records like this:

Screen shot 2010-12-31 at 9.39.17 AM.png

This counts both primary and secondary group memberships.
 

MGSteve

Well-known member
#4
Yup, i did much the same myself in the end, but just thought it would be useful feature to have, without having to whip out the SQL ;)
 

Jake Bunce

XenForo moderator
Staff member
#6
Is there a query that can be run which shows the primary and secondary users separate?
Code:
SELECT ug.title, ug.user_group_id, IF(ugr.is_primary = 1, 'PRIMARY', 'SECONDARY') AS type, COUNT(*) AS numUsers
FROM xf_user_group_relation AS ugr
LEFT JOIN xf_user_group AS ug ON (ug.user_group_id = ugr.user_group_id)
GROUP BY ugr.user_group_id, ugr.is_primary;
Screen shot 2012-02-10 at 12.36.48 AM.png