Rearrange rank icons in logical order if user has more than one rank...

Zhao Yun

New Member
(This is my first time posting any modifications, so please forgive me if my post format seems a bit... chaotic. Also, sorry if I posted it in the wrong forum.)

When a user belongs to multiple user groups and you want ALL the ranks to show, but you want the ranks to show in the order of importance and not the rank they most recently obtained showing at the top, this is for you.

I struggled with this for a bit on my own site, but I finally found a solution. It's not a permanent solution by any means, but it should do until a modification or official feature is released that will do it.

IF USING POSTBIT

Edit Postbit Templates >> postbit

Find...

Code:
<if condition="$post['rank']">
     <div class="smallfont">$post[rank]</div>
</if>

Replace with...

Code:
<if condition="is_member_of($post, 6)">
     <img src="http://www.vbteam.info/images/ranks/administrator.png">
</if>

<if condition="is_member_of($post, 5)">
     <img src="http://www.vbteam.info/images/ranks/mod.png">
</if>

<else>

</endif>

IF USING POSTBIT_LEGACY

Edit Postbit Templates >> postbit_legacy

Find...

Code:
<if condition="$post['rank']">
     <div class="smallfont">$post[rank]</div>
</if>

Replace with...

Code:
<if condition="is_member_of($post, 6)">
     <div class="smallfont"><img src="http://forums.fanbase-online.net/images/ranks/administrator.png"></div>
</if>

<if condition="is_member_of($post, 5)">
     <div class="smallfont"><img src="http://forums.fanbase-online.net/images/ranks/mod.png"></div>
</if>

<else>

</endif>

To add more usergroups, just copy and paste one of the if statements and change the ($userinfo, #), where # would be your usergroup (so, above, 6 would be admin and 5 would be moderator).

USER PROFILE

Edit Member Info Templates >> MEMBERINFO

Find...

Code:
<if condition="$prepared['rank']">
     <div id="rank">$prepared[rank]</div>
</if>

Replace with...

Code:
<if condition="is_member_of($userinfo, 6)">
     <img src="http://www.vbteam.info/images/ranks/administrator.png">
</if>

<if condition="is_member_of($userinfo, 5)">
     <img src="http://www.vbteam.info/images/ranks/mod.png">
</if>

<else>

</endif>

I hope this has helped. I also hope you were able to read it...

Good luck!
 
Top