Detecting Group

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Suggested Hosts
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
Registered User
Posts: 6
Joined: Mon Nov 17, 2008 5:57 am

Detecting Group

Post by forumace »

How do I go about detecting a users group when they are posting? Like in the posting.php. For instance If user is part of group 'x' then do 'y'? Thanks.
A Detailed Medieval Text Adventure
Do not just read the story, become it, and decide the ending.
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: Detecting Group

Post by ameeck »

includes/functions_user.php must be included for this to work:

Code: Select all

if (group_memberships($group_id, $user_id, true))
    // do this
However try to use it as less as possible, since it's not a fast query.

Return to “[3.0.x] Support Forum”