--------------- Added [DATE]1293763857[/DATE] at [TIME]1293763857[/TIME] ---------------
Quote:
Originally Posted by Hornstar
You mentioned "[/B][/COLOR]That does one user group, so you can put that whole thing in a loop, or you could modify the query to get all groups at once and handle the separate lists in the while loop."
Could you give me an example of that.
Thanks again.
An example of which way, the second one?
The first way is easier off the top of my head:
PHP Code:
$groups = array("Super Mods" => 5, "Admins" => 6, "Mods" => 7); // set this to the group id you want
foreach ($groups as $groupname => $groupid)
{
$users = $vbulletin->db->query_read("SELECT username FROM ".TABLE_PREFIX."user
WHERE usergroupid = $groupid");
$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>";
}
but again I haven't tried it so hoepfully there aren't any syntax errors.