I am coding a small app for a client that will allow them to edit certain added fields to the users table. What I am needing is to return all users who are a member of usergroup X (BOTH Primary and Additional Usergroups need to be checked for X).
I know you can do this with a vB function to check if the current logged in user is a member of a group like:
PHP Code:
if (is_member_of($vbulletin->userinfo, X, Y, Z)
Where X Y and Z are a usergroup level. That function checks BOTH 'usergroupid' and 'membergroupids' fields for X Y and Z.
I am needing some SQL like:
SELECT * FROM user WHERE usergroupid = '$level_to_check' OR membergroupids "contains $level_to_check"
The "contains $level_to_check" part is where I am stuck as membergroupids contains data like "4,7,12" and I do not know how to efficiently check for a certain value with data stored in that format.
HELP! Thank you...This is driving me crazy.
-Steve