Resource icon

User Ranks Based on Trophy Points

I got the idea from this thread. What am I doing wrong? I'm editing the sidebar_visitor_panel template.

I'm editing this part:
Code:
<div class="visitorText">
            <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay'}'}</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></a></dl>
            </div>
            </xen:hook>
        </div>

From the tutorial:
Code:
<a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger"><img src="[path_to_image]" class="Tooltip" title="{xen:phrase trophy_points}: {$user.trophy_points}" /></a>

And I have edited the code to this:
Code:
<a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger"><dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></a></dl>

I get an error once I click on points. What am I doing wrong?

EDIT: Thread was merged.
 
Last edited:
I got the idea from this thread. What am I doing wrong? I'm editing the sidebar_visitor_panel template.

I'm editing this part:
Code:
<div class="visitorText">
            <h2>{xen:phrase signed_in_as_x_sidebar, 'name={xen:helper username, $visitor, 'NoOverlay'}'}</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></a></dl>
            </div>
            </xen:hook>
        </div>

From the tutorial:
Code:
<a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger"><img src="[path_to_image]" class="Tooltip" title="{xen:phrase trophy_points}: {$user.trophy_points}" /></a>

And I have edited the code to this:
Code:
<a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger"><dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></a></dl>

I get an error once I click on points. What am I doing wrong?

EDIT: Thread was merged.
On mobile but use this:

Code:
<a href="{xen:link members/trophies, $visitor}" class="concealed OverlayTrigger"><dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></a></dl>

The URL you defined in the 'href' attribute was referencing $user which probably wasn't available in the context and thus you were getting an error. Should be okay now.
 
On mobile but use this:

Code:
<a href="{xen:link members/trophies, $visitor}" class="concealed OverlayTrigger"><dl class="pairsJustified"><dt>{xen:phrase points}:</dt> <dd>{xen:number $visitor.trophy_points}</dd></a></dl>

The URL you defined in the 'href' attribute was referencing $user which probably wasn't available in the context and thus you were getting an error. Should be okay now.
Great, it worked! Thank you, NixFifty. Much appreciated.
 
  • Like
Reactions: Naz
Please share code, it would be helpful to use in XF 2.
So, it looks like what we did was we created a new template (in the example below, I put it as TEMPLATE_NAME) and added the code from the resource for the trophy points to images.

Then go will go into your template "message_macros" and find
<span class="message-userArrow"></span>

Above that, add this line:
Code:
<xf:include template="TEMPLATE_NAME" />
</xf:if>

That should be it.

I haven't looked at the CSS but it should be similar/same. Just make sure the naming conventions are the same throughout and you should be good.
 
Top Bottom