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

XF 1.2 richUserName in visitor_panel?

#1
As the title say, I am looking to add the richUserName or anything else on the username who appear on the visitor panel, I made some research over here and I found nothing about it, but I know it's possible, I did it before... :censored:
The fact is I want the exact line of code to change, because it seems that I can't use it on the visitor_panel for now...
Screenshot : http://prntscr.com/2ykxxr

Thank you for future answers.
 

Jake Bunce

XenForo moderator
Staff member
#2
Admin CP -> Appearance -> Templates -> sidebar_visitor_panel

Add the red piece (9 lines down):

Code:
<xen:if is="{$visitor.user_id}">

<div class="section visitorPanel">
	<div class="secondaryContent">
	
		<xen:avatar user="$visitor" size="m" img="true" />
		
		<div class="visitorText">
			<h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay', 1}'}</h2>		
			<div class="stats">
			<xen:hook name="sidebar_visitor_panel_stats">
				<dl class="pairsJustified"><dt>{xen:phrase messages}:</dt> <dd>{xen:number $visitor.message_count}</dd></dl>
				<dl class="pairsJustified"><dt>{xen:phrase likes}:</dt> <dd>{xen:number $visitor.like_count}</dd></dl>
				<dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></dl>
			</div>
			</xen:hook>
		</div>
		
	</div>
</div>

<xen:else />

<div class="section loginButton">		
	<div class="secondaryContent">
		<label for="LoginControl" id="SignupButton"><a href="{xen:link login}" class="inner">{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
	</div>
</div>

</xen:if>

<xen:include template="ad_sidebar_below_visitor_panel" />
 

Amaury

Well-known member
#3
Admin CP -> Appearance -> Templates -> sidebar_visitor_panel

Add the red piece (9 lines down):

Code:
<xen:if is="{$visitor.user_id}">

<div class="section visitorPanel">
    <div class="secondaryContent">
  
        <xen:avatar user="$visitor" size="m" img="true" />
      
        <div class="visitorText">
            <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay', 1}'}</h2>      
            <div class="stats">
            <xen:hook name="sidebar_visitor_panel_stats">
                <dl class="pairsJustified"><dt>{xen:phrase messages}:</dt> <dd>{xen:number $visitor.message_count}</dd></dl>
                <dl class="pairsJustified"><dt>{xen:phrase likes}:</dt> <dd>{xen:number $visitor.like_count}</dd></dl>
                <dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></dl>
            </div>
            </xen:hook>
        </div>
      
    </div>
</div>

<xen:else />

<div class="section loginButton">      
    <div class="secondaryContent">
        <label for="LoginControl" id="SignupButton"><a href="{xen:link login}" class="inner">{xen:if $xenOptions.registrationSetup.enabled, {xen:phrase sign_up_now}, {xen:phrase log_in}}</a></label>
    </div>
</div>

</xen:if>

<xen:include template="ad_sidebar_below_visitor_panel" />
I've also been wanting to do this, so many thanks for posting this, Jake!
 
#4
You're the best, thank you! :')
Just saying, but it should be as an option on Xenforo to be able to activate rich username. *-*