Conditional help

Ranger375

Well-known member
I'm basically trying to edit the member_user_info template for all my user groups but I am having problems. How would I make the below appear for just admins with an if conditional?

<span class="userrank">Admin</span>



I've searched the forum but havent found an answer :\
 
Admin CP -> Appearance -> Templates -> message_user_info

Add this code:

Code:
		<xen:if is="{$user.is_admin}">
			<span class="userTitle">ADMIN RANK</span>
		</xen:if>

...as shown below:

Code:
<xen:if is="!{$isQuickReply}">
	<h3 class="userText">
		<a {xen:if $user.user_id, 'href="{xen:link members, $user}" '}class="username" itemprop="name">{xen:helper richUserName, $user}</a>
		<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>

		<xen:if is="{$user.is_admin}">
			<span class="userTitle">ADMIN RANK</span>
		</xen:if>

	</h3>

	<xen:if hascontent="true">
		<div class="extraUserInfo">

This is what you get (the rank below the title):

Screen shot 2010-11-07 at 4.10.08 PM.webp
 
Admin CP -> Appearance -> Templates -> message_user_info

Add this code:

Code:
		<xen:if is="{$user.is_admin}">
			<span class="userTitle">ADMIN RANK</span>
		</xen:if>

...as shown below:

Code:
<xen:if is="!{$isQuickReply}">
	<h3 class="userText">
		<a {xen:if $user.user_id, 'href="{xen:link members, $user}" '}class="username" itemprop="name">{xen:helper richUserName, $user}</a>
		<xen:if hascontent="true"><em class="userTitle" itemprop="title"><xen:contentcheck>{xen:helper userTitle, $user}</xen:contentcheck></em></xen:if>

		<xen:if is="{$user.is_admin}">
			<span class="userTitle">ADMIN RANK</span>
		</xen:if>

	</h3>

	<xen:if hascontent="true">
		<div class="extraUserInfo">

This is what you get (the rank below the title):

View attachment 5641


Thanks, Jake. I've been trying to figure out how to get the conditionals to work with the css ranks here: http://xenforo.com/community/threads/user-ranks-in-css-no-images-required.7731/#post-108349

Basically, the rank appears like your example above, but without the same appearance. When I use the example in the post above, the rank appears on everyones post regardless of user group.
 
Regarding that thread:

http://xenforo.com/community/threads/user-ranks-in-css-no-images-required.7731/

I was just posting a change to his instructions. But it appears that the author just updated his post with that very change. Refer to that thread again.

Thanks, that worked perfectly. How would I figure out what to write in the conditional for my custom usergroups? <xen:if is="{$user.is_?????}"> I tried putting in the group and the group number but it didn't work.
 
Top Bottom