Sarcoth
02-18-2010, 08:05 PM
I have the permissions working for viewing my custom page:
if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['showroster_access_groups']))) {
--CODE--
}
Next, I'm trying to completely get out of using a bitfield.xml file for selecting which groups actually appear on my custom page. Right now, my mod adds another column to the usergroup table and the xml file adds the yes/no buttons for each usergroup. That's annoying though because I have to go into each usergroup whenever the mod is installed. I mainly want to make it easier for everyone.
The column added to the usergroup table is: showrosteraddpermissions
This is the code I currently use to make the selected usergroups appear on my custom page:
$users = $db->query_read_slave("
SELECT user.*, usergroup.usergroupid, usergroup.title, user.options, usertextfield.*, userfield.*,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "usergroup AS usergroup
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.usergroupid = usergroup.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
WHERE (usergroup.showrosteraddpermissions = 1)
");
So, my question is, how can I change it to use only the usergroups from the new setting variable instead? Here is what the setting looks like in my product.xml file:
<setting varname="showroster_displayed_groups" displayorder="10">
<datatype>free</datatype>
<defaultvalue><![CDATA[19,13,24,20,17,18]]></defaultvalue>
</setting>
Any help would be appreciated.
if (is_member_of($vbulletin->userinfo, explode(',', $vbulletin->options['showroster_access_groups']))) {
--CODE--
}
Next, I'm trying to completely get out of using a bitfield.xml file for selecting which groups actually appear on my custom page. Right now, my mod adds another column to the usergroup table and the xml file adds the yes/no buttons for each usergroup. That's annoying though because I have to go into each usergroup whenever the mod is installed. I mainly want to make it easier for everyone.
The column added to the usergroup table is: showrosteraddpermissions
This is the code I currently use to make the selected usergroups appear on my custom page:
$users = $db->query_read_slave("
SELECT user.*, usergroup.usergroupid, usergroup.title, user.options, usertextfield.*, userfield.*,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM " . TABLE_PREFIX . "usergroup AS usergroup
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.usergroupid = usergroup.usergroupid OR FIND_IN_SET(usergroup.usergroupid, user.membergroupids))
LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON(userfield.userid = user.userid)
LEFT JOIN " . TABLE_PREFIX . "customprofilepic AS customprofilepic ON (user.userid = customprofilepic.userid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON(usertextfield.userid=user.userid)
WHERE (usergroup.showrosteraddpermissions = 1)
");
So, my question is, how can I change it to use only the usergroups from the new setting variable instead? Here is what the setting looks like in my product.xml file:
<setting varname="showroster_displayed_groups" displayorder="10">
<datatype>free</datatype>
<defaultvalue><![CDATA[19,13,24,20,17,18]]></defaultvalue>
</setting>
Any help would be appreciated.