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

How to hide ads from certain usergroup(s)

Discussion in 'XenForo Questions and Support' started by Geoffrey, Sep 29, 2012.

  1. Geoffrey

    Geoffrey Active Member

    I am in the process of setting up adsense on my forums and I would like to set up an account upgrade (via the xf feature) to promote users to a group that will not see ads for those that don't like them. xD

    What do I have to do, if it's even possible, to do this?

    Thanks for your help. :)
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this template condition:

    <xen:if is="!{xen:helper ismemberof, $visitor, 5}">
    You need to specify the group_id of the privileged group (that will not see ads).
    CabCon, SnoSheriff and andrewkm like this.
  3. Geoffrey

    Geoffrey Active Member

    Okay, so 5 = the group that users are promoted to that pay to not see ads? What do I do to add more than one group to that condition? Will a comma and the next ID work?
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes and yes.
    andrewkm likes this.
  5. kkm323

    kkm323 Well-Known Member

    andrewkm likes this.
  6. Geoffrey

    Geoffrey Active Member

    Thanks for the quick response! :)
  7. Mark Wein

    Mark Wein Member

    I tried doing this and it was blocking the ad for my account as well (the admin account id is 3 and the new user group ID i'm trying to use is 35.) Is this something that still works for 1.2?
  8. Jeremy

    Jeremy Well-Known Member

    The ismemberof helper has not changed.
  9. Mark Wein

    Mark Wein Member

    I just discovered the really stupid thing I was doing...I didn't realize that the adsense code actually went where ADSENSE is in the example. Once I got that right it works perfectly. Thanks :)

Share This Page