induslady
12-14-2007, 04:11 PM
Hello
The code from the file functions_forumlist.php that gets the moderators for a forum and displays it in the Moderator column in forum home page:
$forummoderators = $vbulletin->db->query_read_slave("
SELECT moderator.*, user.username,
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid
FROM " . TABLE_PREFIX . "moderator AS moderator
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
" . ($userid != null ? "WHERE moderator.userid = " . intval($userid) : "") . "
");
while ($moderator = $vbulletin->db->fetch_array($forummoderators))
{
fetch_musername($moderator);
$imodcache["$moderator[forumid]"]["$moderator[userid]"] = $moderator;
$mod["$moderator[userid]"] = 1;
}
$vbulletin->db->free_result($forummoderators);
}
I need to get only the moderators with the specific usergroup ( ids: 5,6,7). For example if in a particular forum there are three moderators say x, y, z with usergroupids : 4 , 6, 8 respectively then I have to obtain only the moderator y. Only this moderator y need to be displayed in the Moderator column in the forum home page.
Let me know how the above query could be modified to make this effective.
Thanks for patiently going through the codes and any help is appreciated.
The code from the file functions_forumlist.php that gets the moderators for a forum and displays it in the Moderator column in forum home page:
$forummoderators = $vbulletin->db->query_read_slave("
SELECT moderator.*, user.username,
IF(user.displaygroupid = 0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid
FROM " . TABLE_PREFIX . "moderator AS moderator
INNER JOIN " . TABLE_PREFIX . "user AS user USING(userid)
" . ($userid != null ? "WHERE moderator.userid = " . intval($userid) : "") . "
");
while ($moderator = $vbulletin->db->fetch_array($forummoderators))
{
fetch_musername($moderator);
$imodcache["$moderator[forumid]"]["$moderator[userid]"] = $moderator;
$mod["$moderator[userid]"] = 1;
}
$vbulletin->db->free_result($forummoderators);
}
I need to get only the moderators with the specific usergroup ( ids: 5,6,7). For example if in a particular forum there are three moderators say x, y, z with usergroupids : 4 , 6, 8 respectively then I have to obtain only the moderator y. Only this moderator y need to be displayed in the Moderator column in the forum home page.
Let me know how the above query could be modified to make this effective.
Thanks for patiently going through the codes and any help is appreciated.