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

XF 1.3 Assistance with applying feature to multiple usergroups

Discussion in 'Styling and Customization Questions' started by WhoIsDo, Aug 10, 2014.

  1. WhoIsDo

    WhoIsDo Active Member

    I've been able to setup what I need, but only for the standard user group. What's the best way I can take this section of code & apply it to multiple user groups (admins, mods, special groups, etc)? Thanks in advance!

    Code:
    <xen:if is="{xen:helper userTitle, $user} == 'Rank 1'">
    <div class="ggbrank1"></div>
    </xen:if>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    One group: <xen:if is="{xen:helper ismemberof, $visitor, x}">

    Multiple groups: <xen:if is="{xen:helper ismemberof, $visitor, x, y}">
     
  3. WhoIsDo

    WhoIsDo Active Member

    For X & Y, I should be using the group's number, right? This code is essentially applying a trophy rank image on top of the user's avatar. I'd only want registered accounts to have it. (thanks for your help)
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. WhoIsDo

    WhoIsDo Active Member

    The issue I'm having with this code is that it's awarding the rank based on a group that they're in rather than their trophy points if I swap it out. Should I just be changing the code to look like this instead?

    <xen:if is="{xen:helper ismemberof, $visitor, x, y}">
    <xen:if is="{xen:helper userTitle, $user} == 'Rank 1'">
    <div class="ggbrank1"></div>
    </xen:if>
    </xen:if>
     
  6. WhoIsDo

    WhoIsDo Active Member

    Anyone have any theories?
     
  7. WhoIsDo

    WhoIsDo Active Member

    Still needing assistance if anyone can help. Not applying to the "Moderating" group for some reason.
     
  8. WhoIsDo

    WhoIsDo Active Member

  9. Brogan

    Brogan XenForo Moderator Staff Member

    I don't really understand what it is you are trying to do.
     
  10. WhoIsDo

    WhoIsDo Active Member

    Sorry, I'll try to explain it better.

    For every user, they'll have a "rank". I've set it up say that each rank they have will have a corresponding image in the upper right-hand section of their avatar (see image below). The code works for 90% of users, but some of them don't actually have the image display.

    upload_2014-8-23_17-12-57.png vs upload_2014-8-23_17-13-34.png vs upload_2014-8-23_17-14-18.png

    Every single user has the same standard "registered" class. A few users who have a moderating permission don't have the rank, but we also have users who are just a regular user who don't have the rank either.

    I have this same code implemented on a few different sites, and there's not one distinct pattern that I can figure out for why it doesn't work for some users. Any help that you or someone else can provide would be greatly appreciated!
     

Share This Page