Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Hide bb_codes for unregistered users vb 5.2 and 5.3.3 Details »»
Hide bb_codes for unregistered users vb 5.2 and 5.3.3
Version: 1.00, by Chicoynano Chicoynano is offline
Developer Last Online: Nov 2022 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 5.3.2 Rating:
Released: 10-01-2017 Last Update: Never Installs: 3
Template Edits
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
delicjous, Zweeper

Comments
  #12  
Old 01-05-2018, 03:53 PM
Chicoynano's Avatar
Chicoynano Chicoynano is offline
 
Join Date: Aug 2017
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zweeper View Post
Works perfect for me. Is it possible to extend this to all Links in a Forum?
It's not possible
Reply With Quote
  #13  
Old 03-04-2020, 01:53 PM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did a Update to 5.6.0 RC2, suddenly it always hides the code (also to registered users). Any idea what I could do?

If I edit the specific post, the content is still ok like

[code ]
REAL CONTENT
[ /code]

EDIT:

Fixed it, just opened and saved the template and it worked again. No changes made.
Thanks again to Chicoynano!
Reply With Quote
  #14  
Old 03-05-2020, 03:47 AM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK here is the strange thing, it works in some posts and in some other it is not working.
Any idea what to do?
Reply With Quote
  #15  
Old 03-09-2020, 04:38 AM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any help?
Reply With Quote
  #16  
Old 03-10-2020, 07:13 AM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Trying my luck here, for people who are maybe running in similar problems and in case I can find a soltuion


https://vborg.vbsupport.ru/showthrea...97#post2602297
Reply With Quote
  #17  
Old 03-10-2020, 06:43 PM
Zweeper Zweeper is offline
 
Join Date: Jan 2005
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It only works if I add usergroup "1" to the code (guests). Then its shown to all.
Otherwise its hidden for all. Strange...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04138 seconds
  • Memory Usage 2,285KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (2)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete