MyBB Community Forums

Full Version: Show how many members are in a group?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On my site http://Vorkinpride.com, I have a showgroups page http://Vorkinpride.com/showgroups.php how can I make it so it show members. I have seen many forums do this, But none will tell sadly.
I guess you'll need a db query for each usergroup, like this (where X is group ID):

$eternalgroup = $db->num_rows($db->simple_select("users", "uid", "usergroup='X'"));
echo intval($eternalgroup);
Oo, Maeko here. c:

$countadmins = $db->write_query( "SELECT COUNT(*) AS totaladmins FROM ".TABLE_PREFIX."users WHERE `usergroup` = 4 " );
$totaladmins = my_number_format($db->fetch_field($countadmins, "totaladmins")); 

Use {$totaladmins} as variable, this will show all admins.
(2015-10-04, 06:24 PM)Sazze Wrote: [ -> ]Oo, Maeko here. c:

$countadmins = $db->write_query( "SELECT COUNT(*) AS totaladmins FROM ".TABLE_PREFIX."users WHERE `usergroup` = 4 " );
$totaladmins = my_number_format($db->fetch_field($countadmins, "totaladmins")); 

Use {$totaladmins} as variable, this will show all admins.

The php just goes on the page also?
Does the PHP go in the showgroups.php

and the {$totaladmins} go in the template?