vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Forum Home Enhancements - Hide bb_codes for unregistered users vb 5.2 and 5.3.3 (https://vborg.vbsupport.ru/showthread.php?t=325638)

Chicoynano 10-01-2017 09:00 PM

Hide bb_codes for unregistered users vb 5.2 and 5.3.3
 
1 Attachment(s)
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

raverchr 10-25-2017 05:53 AM

Hello I have it adjusted exactly the same but with me does not work unfortunately there is still another solution?

Chicoynano 10-26-2017 01:21 PM

Quote:

Originally Posted by raverchr (Post 2590741)
Hello I have it adjusted exactly the same but with me does not work unfortunately there is still another solution?

Try this on the template bbcode_code
In my work I 5.2 and 5.3.3

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, 1, 2)">
 <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:{vb:raw blockCssHeight};"</vb:if>>{vb:raw code}</pre>
<vb:else />
    {vb:rawphrase hide_code}


</vb:if>
</div>


Chicoynano 10-27-2017 02:05 PM

Quote:

Originally Posted by raverchr (Post 2590741)
Hello I have it adjusted exactly the same but with me does not work unfortunately there is still another solution?

You must clear the system cache as well as the browser cache.

Zweeper 11-03-2017 07:49 PM

It also unfortunately wont work for me :(
I am using 5.3.3

Wayne Luke 11-08-2017 06:42 PM

Try 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>
<vb:if condition="is_member_of($user, 2, 3, 6)">
        <pre class="bbcode_code"<vb:if condition="$vboptions['codemaxlines']"> style="height:{vb:raw blockCssHeight};"</vb:if>>{vb:raw code}</pre>
<vb:else />
        {vb:rawphrase hide_code}
</vb:if>
</div>

After altering the template, make sure to clear your system cache.

shneler2010 11-27-2017 04:11 PM

is it work for 5.3.4 ?

shneler2010 12-15-2017 11:35 AM

Quote:

Originally Posted by shneler2010 (Post 2591278)
is it work for 5.3.4 ?

any news ?

Chicoynano 12-21-2017 04:00 PM

Quote:

Originally Posted by shneler2010 (Post 2591622)
any news ?


For me it works perfect for 5.3.3 to 5.3.4 I have no news

Zweeper 12-30-2017 05:34 PM

Works perfect for me. Is it possible to extend this to all Links in a Forum?


All times are GMT. The time now is 05:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01325 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete