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

XF 1.4 Conditionals for Secondary Usergroups

Discussion in 'XenForo Questions and Support' started by Movie Prop Sites, Feb 4, 2015.

  1. Yes, I know I am not the first to ask about this. I did do a search and saw that others have asked before, but for some reason, the solutions provided there don't seem to be working for me and I am not sure what I am doing wrong.

    All of our members have Registered Members as their primary usergroup.

    We have a usergroup called Full Members which members are promoted to automatically after being a member for 90 days AND making 50 posts. This is a secondary groups and provides a few bonuses for members like being able to create threads in certain forums.

    We want to limit ads for members who have the Full Members usergroup as their secondary group (keep in mind, their primary group is still Registered Members).

    Full Member is group 6

    Registered Member is group 2

    Looking at @Brogan 's Conditional Statements, we added:

    <xen:if is="!{xen:helper ismemberof, $visitor, 6}">
    Ad content

    After adding this conditional, all members, including those with the Full Member secondary group still show the ad.

    After reading this thread:

    I changed the code to:
    <xen:if is="!{xen:helper ismemberof, $user, 6}">
    Ad content

    Same result. Everyone sees the ad.

    After reading this thread:

    I changed the code to:
    <xen:if is="{xen:helper ismemberof, $visitor, 6}">
    <xen:else />
    Ad content
    Same result. Everyone sees the ad.

    Now... if I go with a completely different conditional, such as:

    <xen:if is="{$visitor.message_count} < 50">
    Ad content

    It works exactly as expected... but I don't want that to be the conditional. I want to base it off group membership.

    What am I doing wrong?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    This should work.

    5. How can I hide content from a specific user group?
    <xen:if is="!{xen:helper ismemberof, $visitor, x}">
    This content will be hidden from members of user group x
  3. That is the first configuration I tried and for some reason, members of the "x" secondary usergroup are still seeing the content. :(
  4. Allpar Dave

    Allpar Dave Member

    I hate to dredge this up, but I am having the same problem.

    <xen:if is="{xen:helper ismemberof, $visitor,1,2,3,13,20,26}">
    does not work because when members upgrade, their secondary group, ,not their primary group, is changed, and I can't find the code for secondary group checks.
  5. Allpar Dave

    Allpar Dave Member

    Oh, wait, i think I figured it out, I need to NOT show it to people in upgraded groups. Never mind.
  6. AntonyF

    AntonyF Member

    Hi. Did you find any solution to this? I've read about 20 threads and have no answer.

    What I want to achieve is simple.

    I have a secondary group number 49.

    I want to show an advert to everyone EXCEPT those with 49 as a secondary group.

    But it's alluding me.
  7. Martok

    Martok Well-Known Member

    The answer is in post #2. Replace x with 49. It does work as I use this code on my site to hide ads from a specific usergroup.
  8. AntonyF

    AntonyF Member

    You know, I tried that multiple times I swear... just did it, and it worked.

    Totally bemused... but thank you fro making me revisit it!

Share This Page