Back to vBulletin 5.x Template Modifications

Hide bb_codes for unregistered users vb 5.2 and 5.3.3
Mod Version: 1.00, by Chicoynano

vB Version: 5.3.2 Rating: (1 vote - 4.00 average) Installs: 3
Released: 02 Oct 2017 Last Update: Never Downloads: 0
Not Supported Template Edits  

IMPORTANT NOTE IS NOT COMPATIBLE WITH THE NEW VERSIONS 5.6.X

First of all, I apologize for my english because I use google translate.I found a solution for BBcodes to be invisible to the unregistered.It is tested both in VB 5.2 and 5.3.3.
Admincp » Languages & Phrases » Phrase Manager » Add New Phrase
Phrase Type : GLOBAL
Product : vBulletin
Varname : hide_code
Text : Please Login or <a href="register.php">Register</a> to see codes
Go to your Admincp » Styles & Templates » Style Manager » Your Style » BB Code Layout Templates

Open bbcode_code will see this code:
Code:
<vb:if condition="$vboptions['codemaxlines']">
	{vb:set verticalPadding, 12}
	{vb:set horizScrollbarAllowance, 20}
	{vb:set blockCssHeight, {vb:math {vb:raw blockheight} * {vb:stylevar bbcode_code_line_height} + {vb:raw verticalPadding} + {vb:raw horizScrollbarAllowance}}}
</vb:if>
<div class="bbcode_container">
	<div class="bbcode_description">{vb:rawphrase code}:</div>
	<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:{vb:raw blockCssHeight};"</vb:if>>{vb:raw code}</pre>
</div>
Substitute for this one. Always remember that the id of users will be the ones of your forum. (Usually unregistered ID: 1) (For other users you choose who has permission)

Code:
<vb:if condition="$vboptions['codemaxlines']">
	{vb:set verticalPadding, 12}
	{vb:set horizScrollbarAllowance, 20}
	{vb:set blockCssHeight, {vb:math {vb:raw blockheight} * {vb:stylevar bbcode_code_line_height} + {vb:raw verticalPadding} + {vb:raw horizScrollbarAllowance}}}
</vb:if>
<div class="bbcode_container">
	<div class="bbcode_description">{vb:rawphrase code}:</div>
<vb:if condition="is_member_of($user, 2, 3, 6, 29, 31)">
	<pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:{vb:raw blockCssHeight};"</vb:if>>{vb:raw code}</pre>
</vb:if>
	<vb:if condition="is_member_of($user, 1)">{vb:rawphrase hide_code}
</vb:if>
</div>

The same code can be used for html_code and php_code. Changing of course {vb: rawphrase code} for the corresponding one in each case for html {vb: rawphrase html_code} and for php {vb: rawphrase php_code}

Any doubts or clarifications in comments, as well as if they were useful, I did several hours to find this solution and I hope it will be useful

Download

No files for download.

Similar Mods

Mini Mods Hide BB Code Content From Unregistered Users vBulletin 4.x Template Modifications
Users Can Hide Posts From Unregistered Browsers vBulletin 3.6 Template Modifications
Hide Posts To Unregistered Users - Posting Option vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024