I am attempting to have a page which lists all users in a usergroup (additional usergrou). I realize I am able to do so via ACP, but I wish to have this list accessible to moderators.
I have the following code below, but am not sure where lies the error.. any help is appreciated.
Code:
<?php
$groupid = 43;
$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 "Market Banned: $str";
?>