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.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
forumace
Registered User
Posts: 6
Joined: Mon Nov 17, 2008 5:57 am
Contact:

Detecting Group

Post by forumace » Mon Nov 17, 2008 6:09 am

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.

User avatar
ameeck
Former Team Member
Posts: 6559
Joined: Mon Mar 21, 2005 6:57 pm

Re: Detecting Group

Post by ameeck » Mon Nov 17, 2008 4:36 pm

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.

Locked

Return to “[3.0.x] Support Forum”