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

XF 1.3 Show Item to Registered Usergroup Only

Discussion in 'XenForo Questions and Support' started by SatGuyScott, May 30, 2014.

  1. SatGuyScott

    SatGuyScott Active Member

    I just switched over from vBulletin. My site is kind of complicated as I provide private support and beta testing for a number of companies and products. I have a total of 14 usergroups.

    Per the Xenforo Documentation I made all usergroups primary usergroup the registered user and then assigned them secondary usergroups, based on what they should have access to.

    This has worked great for me except for one thing... I have been for the past 4 hours trying how to figure out how to show something to the REGISTERED usergroup and the registered usergroup ONLY. However since everyone is part of the registered usergroup everyone is seeing it.

    I have been through the conditionals FAQ and I can't figure it out.

    How do I make a conditional so that only the registered #2 group sees what I want to show them yet everyone else does not see it?!!

    Help please as I said I have been trying for over 4 hours now!

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Everyone should be in the Registered user group as the primary user group so your question doesn't really make sense.

    By definition, everyone is registered and secondary user groups are added based on various criteria.

    It sounds as if you need to use this conditional statement:
  3. SatGuyScott

    SatGuyScott Active Member

    Ahh I was missing the ! THANK YOU!

    My other issue now is I have a paid membership where members who pay don't see adds. I also have 3 joinable usergroups which any usergroup can join.

    If I use the method above that you posted and do not include the 3 joinable usergroups then those paying not to see ads... see ads. but if I set it so those 3 joinable usergroups to exclude the ads then anyone who joins the group don't see the ads anymore. They get the ad free version of the site for free, which as you can guess is not good.

    Any ideas here?
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I'm not sure I understand.

    You want the member of thoses user groups, who pay to uprade, not to see adverts.
    But at the same time, anyone can join them for free?

    Surely your paid upgrades and free joinable user groups should be different?
  5. SatGuyScott

    SatGuyScott Active Member

    No No.

    We have 3 joinable usergroups, that any member can join.

    1) A Joinable usergroup for those who are professional Satellite Installers. If they join they get access to a special forum for Satellite Installers.
    2) A Joinable usergroup to talk Politics, if a user joins the group they are giving access to that forum.
    3) A Joinable usergroup to talk about Unscrambled Satellite Feeds (This is a private area as we done want Google indexing these because these feeds disappear when they appear on Google.)

    All 3 of these groups are open to all members to join.

    So lets take a look at my (simplified) usergroups list.


    So now lets say I am someone who does NOT pay so I should see ads. How do I do it?

    My usergroups for this user are 2, 6, 8

    Now we have a user who does pay and should not see ads. How do I make it so they do not see ads?

    The usergroups for this user are 2, 5, 6, 8

    Hopefully I explained this better now. :)

    Thank you again for your help!
  6. Tracy Perry

    Tracy Perry Well-Known Member

    Wrap the ad with a conditional.
    <xen:if is="!{xen:helper ismemberof, $visitor, 8}">
    Ad texxt here
  7. SatGuyScott

    SatGuyScott Active Member

    I don't think that would work. What about the other usergroups of 5 & 6? Not to mention that group 5 should not see the ad, while group 2 should. That conditional does nothing to deal with the usergroups besides group 8 unless I am missing something.

    Someone could make a lot of money making a conditional maker, where you check off the groups you want to access something and not access other things... click a button and it pops out a conditional. :D
  8. Tracy Perry

    Tracy Perry Well-Known Member

    That's not what your example showed. It only shows that group #5 does not see ads. if you want 5-8 to not see them then just replace the 8 with an array of the groups you don't want to see. Brogan has a guide out (in his signature) for the use of conditionals (and arrays).
  9. Tracy Perry

    Tracy Perry Well-Known Member

    To save you some time (but you DO need to review the conditional guides)

    <xen:if is="!{xen:helper ismemberof, $visitor, 5,6,7,8}">
    Ad texxt here
  10. SatGuyScott

    SatGuyScott Active Member

    No your missing the point...

    Both the non paying member and the paying member are members of 2, 6, 8 the only difference is the member paying not to see ads also belongs to usergroup 5 as well.

    Confusing aint it? :)
  11. SatGuyScott

    SatGuyScott Active Member

    If you did that then anyone who joined groups 6, 7 or 8 would not be shown ads, when they didn't pay to. That's the issue.

    You can read the conditional guide a million times (I am almost there) and there is nothing in there like this. :)
  12. Tracy Perry

    Tracy Perry Well-Known Member

    No.. if user group 5 is the only group that should NOT see the ads, then my first example is correct.
    Specifically what EXACT groups should not see the ads?
    If the only group that shouldn't is 5 - then you are trying to make it more difficult than it is.
    What the example does is if the member is NOT in group 5, they see the ad (that's what the != is for).
  13. SatGuyScott

    SatGuyScott Active Member

    Correct Only group 5 should not see ads.

    Should it maybe be a 5 in here instead of an 8?

    <xen:if is="!{xen:helper ismemberof, $visitor, 8}">
    Ad texxt here
    Thanks for your help I do appreciate it.... I have been working on this since 1pm this afternoon. (Its now 11PM here.) :)
  14. Tracy Perry

    Tracy Perry Well-Known Member

    yep.. forgot to change it from mine. :oops:
    It's what I use and it works fine. Guess I could blame it on the fact I'm trying out a new "contacts" technique. One in (for far vision) and one out (for close) and one heck of a headache from the eyes competing against each other. :p

Share This Page