XF 2.1 Link an image/icon to trophy point

KSA

Well-known member
Hello,

I am trying to customize a ranking system based on trophy points and display an image/icon on postbit as users move along the ladder.

I am using a conditional statement to insert the desired image for each however, I have my trophy points defined for each trophy as follow

Trophy 1
  • User has posted at least 100 messages:
  • User has posted no more than 299 messages:
Trophy 2
  • User has posted at least 300 messages:
  • User has posted no more than 499 messages
.....etc.

My conditional statement is
Code:
<xf:if is="$user.trophy_points|number > x">
  Show content...
</xf:if>

Is not that not going to duplicate and display multiple images/icons on postbit if user received multiple trophies as he/she moves up along the ladder? if so how can i define the exact number of posts in my conditional statement as given in the example above?
 
Once granted, trophies aren't removed once a user doesn't fulfill the conditions anymore, so your chosen approach does not work. Their trophy points are cumulative though, so you can use that for your conditional.
 
  • Like
Reactions: KSA
Once granted, trophies aren't removed once a user doesn't fulfill the conditions anymore, so your chosen approach does not work. Their trophy points are cumulative though, so you can use that for your conditional.

Thanks

Code:
<xf:if is="$user.trophy_points|number >= 10">
                       <img src="\styles\img1.png">

My question was will I run into duplicate images being displayed on postbit if a user received multiple trophies as moving up the ladder. Being cumulative or not does not really matter. Trophy points will be calculated and add to the template to display the desired image/icon once the trophy condition is fulfilled. Hope that makes sense.:unsure:
 
Back
Top Bottom