MyBB Community Forums

Full Version: Usergroup
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I'm looking for a bit of code that will enable me to find out what usegroups members are in.

For example, I'm an admin but I'm also in another group called the restroom. When I check with php for my usergroup it comes back as 4 but I'm also in usergroup 8.

So, what can I do to return both values in any code I write?

Thanks.
Write a query to check both the "mybb_users" table and the "mybb_usergroups" table, then compile an array based on both the results of those queries and return that array from the function.
Why query when it's already there??

$groups = array_merge(array($mybb->user['usergroup']), explode(",", $mybb->user['additionalgroups']))

That'd probably work.
Great Big Grin