Jump to content
vBWarez - Rest In Peace

Hide BB Code Content From Unregistered Users


Recommended Posts

[B][COLOR="#FF0000"]vB Version: 4.x.x[/COLOR][/B]

I couldn't find any addon for vb 4 to hide the bbcode content from unregistered users and showing a register message instead as here on vbulletin.org,so i have just fixed manualy on my forum.
add a new phrase first from 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

[B][COLOR="#FF0000"]Open the bbcode_code template and find:[/COLOR][/B]

[CODE]<div class="bbcode_description">{vb:rawphrase code}:</div>[/CODE]

[B][COLOR="#FF0000"]add this below:[/COLOR][/B]

[CODE]<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />[/CODE]

[B][COLOR="#FF0000"]In the same template add above the last </div> :[/COLOR][/B]

[CODE]</vb:if>[/CODE]

[B][COLOR="#FF0000"]Open the bbcode_html template and find:[/COLOR][/B]

[CODE]<div class="bbcode_description">{vb:rawphrase html_code}:</div>[/CODE]

[B][COLOR="#FF0000"]add this below:[/COLOR][/B]

[CODE]<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />[/CODE]

[B][COLOR="#FF0000"]In the same template add above the last </div> :[/COLOR][/B]

[CODE]</vb:if>[/CODE]

[B][COLOR="#FF0000"]Now Open the bbcode_php template and find:[/COLOR][/B]

[CODE]<div class="bbcode_description">{vb:rawphrase php_code}:</div>[/CODE]

[B][COLOR="#FF0000"]add this below:[/COLOR][/B]

[CODE]<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />[/CODE]

[B][COLOR="#FF0000"]In the same template add above the last </div> :[/COLOR][/B]

[CODE]</vb:if>[/CODE]

  • Like 1
Link to post
Share on other sites
  • 5 months later...
Hello, If I would like to add a image and not the text how would the code look?

[CODE]Phrase Type : GLOBAL
Product : vBulletin
Varname : hide_code
Text : Please Login or <a href="register.php">Register</a> to see codes


<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />[/CODE]
Link to post
Share on other sites
  • 1 month later...
  • 3 weeks later...
  • 4 months later...
  • 5 months later...
  • 1 year later...
×
×
  • Create New...