View Full Version : Hide certain postbit elements via option in user CP?
Rlad78
04-18-2015, 08:05 PM
Some of our users have been asking us if there can be ways to change what displays in the postbit, specifically user rank images. How can we make user rank images toggleable on or off so members who do not wish to view them can turn them off from the postbit? I know it's easy to just AdBlock but that's not the sort of solution they want to hear, haha.
Thank you!
Lynne
04-18-2015, 08:25 PM
They want to block *everyone's* ranks (not just their own)? Create a user profile field (Do you wish to hide user ranks in threads - Yes or No) and then get the field id and put a condition around the area in the postbit (or postbit_legacy, whichever you use):
<if condition="$bbuserinfo[fieldx] == No">
Rank Code</if>
Change x to the profile field number.
Rlad78
04-19-2015, 01:40 AM
Thank you, it worked! But now the user rank images are being hidden by default despite "No" being set as the first option. Is there any way to make them show by default?
blind-eddie
04-19-2015, 12:13 PM
Try this.
<if condition="$post['rank'] AND $bbuserinfo['fieldxx'] != 'No' ">
Rank Code</if>
--------------- Added 1429453370 at 1429453370 ---------------
I see what the problem is, the code Lynn posted:
<if condition="$bbuserinfo[fieldx] == No">
Should have been:
<if condition="$bbuserinfo['fieldx'] == No">
Lynne
04-19-2015, 10:55 PM
That works on my site in my postbit (I copied it from there), but perhaps I'm on a different version and it worked back then.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.