MyBB Community Forums

Full Version: Identifying the group to which someone belongs in custom application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Okay,

I got a partial solution with this very helpful posts:
http://community.mybb.com/thread-131840.html

but now I need to identify the specific groups to which someone belongs (or, in this case, to ensure they are a member of one specific group). I tried to list out the values of the $mybb array, but could not.

How can I obtain the Group ID (and a listing of all the $mybb array values)?

Thanks

Well, I tried looking at $groupscache, and listing it out using

print_r(array_keys($groupscache));

but all I got was an array of values I could not interpret:

ArrayArray ( 
[0] => 1 
[1] => 2 
[2] => 3
 [3] => 4
 [4] => 5
 [5] => 6 
[6] => 7
 [7] => 8
 [8] => 12
 [9] => 13
 [10] => 15 )

Nevermind, I solved this.

SELECT bb_users.uid,  bb_users.username,  	bb_users.additionalgroups, bb_users.usergroup FROM bb_users WHERE (bb_users.additionalgroups like '%%##%%' OR usergroup=#) and   uid=$mybb->user['uid'] "