|
إنضمامك إلي منتديات استراحات زايد يحقق لك معرفة كل ماهو جديد في عالم الانترنت ...
انضم الينا
#1
| ||
| ||
I'm trying to get a query to only pull usergroups that have been selected in an options menu. The setting option is named showroster_displayed_groups which I installed via a products.xml file: Code: free This isn't a permission to view thing, it is more like choosing which usergroups will be displayed. Here is the current query and it works fine, except I can't figure out how to only pull the usergroups I entered above: PHP Code: $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) "); I know I need a WHERE option at the end, but I just haven't had any luck with anything I've tried. One thing I tried was to do a query on the $vbulletin->options['showroster_display_groups']: PHP Code: $displaygroups = explode(',', $vbulletin->options['showroster_display_groups']); But, then I couldn't figure a way to compare that in the main query. I've also tried creating a new table in my database and then using that to compare within my query, but that just gave me database query errors. I hate to admit it, but I'm stuck. I would appreciate any help, even a suggestion in the right direction. Thank you for your time. __DEFINE_LIKE_SHARE__ |
مواقع النشر (المفضلة) |
| |