XF 1.5 Code for ranks based on amount of Posts and Number of Likes?

Brad Padgett

Well-known member
There's a tutorial I found on how to have ranks based on trophy points by AzzidReign.

It shows the code below:

Code:
   <xen:if is="{$user.trophy_points} >= 130">
            <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>
        <xen:elseif is="{$user.trophy_points} >= 85" />
            <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>
        <xen:elseif is="{$user.trophy_points} >= 50" />
            <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>
        <xen:elseif is="{$user.trophy_points} >= 30" />
            <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>
        <xen:elseif is="{$user.trophy_points} >= 15" />
            <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>
        <xen:elseif is="{$user.trophy_points} >= 5" />
            <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>
        <xen:elseif is="{$user.trophy_points} >= 0" />
            <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>
        </xen:if>

While reading this tutorial I found out it was also possible to base ranks on the post count and also the number of likes a user has.

You would simply use:

Code:
{$user.posts}

Is this the correct code for the posts? If so, how should I place it for the amount of likes a user has.

Instead of using the amount of trophy points, I've been wanting to have a custom made rep bar for likes and also some stars for posts.

This is very educational for other members to see so if you don't mind pointing me towards the correct code to use I would appreciate it a lot. Many members can learn from this.

Thanks guys.

Regards,

TheXboxCloud
 
If you want to check which parameters are available in the template you are editing, you can add this:
Code:
{xen:helper dump, $user}

Then load the page again.

You should see an array with all of the various parameters listed and you can use any one of those.

If NULL is returned or the parameter you want isn't listed, then you can't use it.
 
If you want to check which parameters are available in the template you are editing, you can add this:
Code:
{xen:helper dump, $user}

Then load the page again.

You should see an array with all of the various parameters listed and you can use any one of those.

If NULL is returned or the parameter you want isn't listed, then you can't use it.

Okay I'll give it a try. Appreciate the help.

If anyone has the direct code in the mean time let me know. I will go ahead and try this method.

(The template I'm editing is message_user_info)

Can someone just reply with the correct code? All I need is for likes and posts.

It's not a big deal. I was told it's either user.messages or user.posts

And then what to use for likes.
 
Last edited:
Back
Top Bottom