Jump to content

show ranks level in posrbit


Recommended Posts


I use below code to show user's rank level in postbit and everything good works:

{{if $comment->author()->canHaveAchievements() and \IPS\core\Achievements\Rank::show() and \IPS\core\Achievements\Rank::getStore() and $rank = $comment->author()->rank()}}
           <div class="postlevel">
              {{if $nextRank = $comment->author()->nextRank()}}
              <div class="postlevel_content">
                <span class="postlevel_levels">{$rank->rankPosition()['pos']} level</span>
                <span class="postlevel_exp" ><b>{$comment->author()->achievements_points}</b> / {$nextRank->points}</span>
              <div class="postlevel_progress">
                <div class="postlevel_progress_bar" style="width: calc({expression='$comment->author()->achievements_points'} / {$nextRank->points} * 100%);"></div>

I want to put these codes in a new HTML template file and call them using the following method in postcontainer, but I get an error.

{template="pos_ranks" app="core" group="xxx" location="front" params=""}

what do I do?




Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using our site you agree to our Privacy Policy