User Ranks in CSS

User Ranks in CSS 1.0

No permission to download
Two ways of doing it:
Code:
{xen:if '{$user.user_id} == 42', '<span class="userrank">Rank-for-member-42</span>'}
Code:
<xen:if is="$user.user_id == 42"><span class="userrank">Rank-for-member-42</span></xen:if>
Yeah, already figured it out by poking it until it worked a while back. Thanks anyway though :)
 
Just curious but you have used border-radius: 5px; Does XenForo automatically parse that for each vendor-specific prefix (-moz, -webkit (though not necessary), -khtml, etc), or have you just used the default because it's easier?
On my Mac it shows round corners in Firefox, but I thought older versions need the -moz?
 
On my Mac it shows round corners in Firefox, but I thought older versions need the -moz?
Yeah vendor-specific prefixes are still needed for some, I just wondered if XenForo had functions to split border-radius into each vendor prefix.
 
The CSS above can be edited to your own taste. You can ask for help in this thread if needed :)

This is a great edit, is it possible to have something other than the user rank.

EG instead of 'Admin/Moderator' you would have 'XenForo Staff' and instead of 'Registered' you could have 'Xenforo Addict' etc
 
Awesome :) Now I only have one little challenge:

In our forum you can have more than 2 titles - some of us have 3 or 4 ... I have for example the titles:

Media Manager
Wiki Wookie
Contributor
Administrator

How can you make it possible to have banners for all your titles?

I have the same issue, I would like to display more than 2 ranks, is there a specific conditional to see which secondary groups a member is part of?
 
<xen:if is="{xen:helper ismemberof, $user, 1}"></xen:if>

That will apply to all members in user group 1, primary or secondary.

You sir, are a life saver, thanks much!

I was looking at that conditional, but wasn't sure if it would work in the xen:if or not without having an == or != condition in it. Thanks again.
 
<xen:if is="{xen:helper ismemberof, $user, 1}"></xen:if>

That will apply to all members in user group 1, primary or secondary.

This doesn't seem to work. I get the following error...

The following error occurred:

The following templates contained errors and were not saved: message_user_info: 1) Line 115: Template syntax error.
This is the code I'm using...

<!-- Start User Ranks -->

<xen:if is="{$user.is_admin}">
<span class="userrank"><img src="styles/flexile/xenforo/ranks/admin.png"></span>
</xen:if>

<xen:if is="{xen:helper ismemberof, $user, 2}"></xen:if>
<span class="userrank"><img src="styles/flexile/xenforo/ranks/banned.png"></span>
</xen:if>

<!-- End User Ranks -->

The first one works for admin but the second one for 'registered' isn't working at all. I get the above error instead.
 
This doesn't seem to work. I get the following error...

This is the code I'm using...

<!-- Start User Ranks -->

<xen:if is="{$user.is_admin}">
<span class="userrank"><img src="styles/flexile/xenforo/ranks/admin.png"></span>
</xen:if>

<xen:if is="{xen:helper ismemberof, $user, 2}"></xen:if>
<span class="userrank"><img src="styles/flexile/xenforo/ranks/banned.png"></span>
</xen:if>

<!-- End User Ranks -->

The first one works for admin but the second one for 'registered' isn't working at all. I get the above error instead.

Not experienced in this at all (yet), but try removing the bold </xen:if>, I'm guessing it should go at the end of the block (where you already have one)
 
Not experienced in this at all (yet), but try removing the bold </xen:if>, I'm guessing it should go at the end of the block (where you already have one)

This is exactly why a fresh pair of eyes are often needed, I kept skimming that extra </xen:if> because I just copied and pasted Brogans code.

Thanks Steve, that fixed it :D
 
This is exactly why a fresh pair of eyes are often needed, I kept skimming that extra </xen:if> because I just copied and pasted Brogans code.

Thanks Steve, that fixed it :D
Copy and Paste - its the source of many a problem ;)

Glad I could help.
 
Just wanted to say Thanks for this ... (y)

We're going to use it to label all of our Support Team members; this will stop regular members faking support status by altering their user title ... :D
 
Top Bottom