1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Restrict Content To Certain Groups

Discussion in 'XenForo Development Discussions' started by Xarcell, Dec 27, 2010.

  1. Xarcell

    Xarcell Well-Known Member

    I'm trying to figure out a way to restrict content to certain multiple groups.

    I found this topic that restricts content to a group, but not multiple groups. This is something that is essential for my site.

    Any help?
  2. Jeremy

    Jeremy Well-Known Member

    I believe using OR statements would work.
  3. Xarcell

    Xarcell Well-Known Member

    I'm not sure what that means, but I have 105 groups. I need groups 16-97 to have access to the content.
  4. Xarcell

    Xarcell Well-Known Member

    I thought I'd try this:
    <xen:if is="!{xen:helper checkusergroup, $visitor, 1, 11, 12, 13, 14, 15}">
        // User who does NOT belong to any of the listed usergroups
    Is supposed to work for those who are NOT in those groups listed. But it didn't seem to work.
  5. Brogan

    Brogan XenForo Moderator Staff Member

    Does the helper function support arrays?
  6. Xarcell

    Xarcell Well-Known Member

    actually, I found that post through search. After backing up to the beginning, I realized that it is a add-on. So now I'm attempting to install the add-on in beta 5. having issues with that too, but let me try a few things and I'll get back to ya.
  7. Xarcell

    Xarcell Well-Known Member

    I managed to get everything working. :p

    Thanks guys...
  8. ragtek

    ragtek Guest


         * Determines if a user is a member of a particular user group
         * @param array $user
         * @param integer $userGroupId
         * @param boolean Also check secondary groups
         * @return boolean
    public function isMemberOfUserGroup(array $user$userGroupId$includeSecondaryGroups true)
  9. Brogan

    Brogan XenForo Moderator Staff Member

    Glad to hear it.

    With 105 groups though, it's going to take some time to set up :D

Share This Page