• 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

WhoIsDo

Active member
#1
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>
 

Brogan

XenForo moderator
Staff member
#2
One group: <xen:if is="{xen:helper ismemberof, $visitor, x}">

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

WhoIsDo

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

Multiple groups: <xen:if is="{xen:helper ismemberof, $visitor, x, y}">
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)
 

WhoIsDo

Active member
#5
Yes, x and y relate to the group ID.

If you have your user groups set up correctly though, every member will be in the Registered user group as the primary.

http://xenforo.com/community/resources/implementing-permissions-across-multiple-user-groups.358/
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>
 

WhoIsDo

Active member
#10
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!