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

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

MGSteve

Well-known member
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!
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
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.webp

This counts both primary and secondary group memberships.
 
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 ;)
 
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.webp
 
Top Bottom