OK, it turned out to be pretty easy (thanks to the code in showgroups.php):
PHP Code:
$groups = array("Super Mods" => 5, "Admins" => 6, "Mods" => 7);
foreach ($groups as $groupname => $groupid)
{
$users = $vbulletin->db->query_read("SELECT username FROM ".TABLE_PREFIX."user
WHERE usergroupid = $groupid OR FIND_IN_SET($groupid, membergroupids)");
$str = '';
$sep = '';
while ($user = $vbulletin->db->fetch_array($users))
{
$str .= $sep . $user['username'];
$sep = ', ';
}
// $str is comma separated list of users in $groupid
$vbulletin->db->free_result($users);
echo "$groupname: $str <BR></BR>";
}
I was thinking of trying to do it the other way so that it would be only one query, but really it's starting to get to the point where it would have been easier to start with showgroups.php. And as long as you're not putting this on your home page or anything, it probably won't make any difference.
Quote:
Originally Posted by Hornstar
If you work out how to get it to work with primary and secondary you will be legendary.
|
Well, not so much legendary, more like 'too much free time', but anyway...