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

Reply
 
Thread Tools
Hide BB Code Content From Unregistered Users Details »»
Hide BB Code Content From Unregistered Users
Version: 1.00, by ALBCODERS ALBCODERS is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.x.x Rating:
Released: 06-11-2011 Last Update: Never Installs: 23
Template Edits
Re-useable Code  
No support by the author.

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

Open the bbcode_code template and find:
HTML Code:
<div class="bbcode_description">{vb:rawphrase code}:</div>
add this below:
HTML Code:
<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />
In the same template add above the last </div> :
HTML Code:
</vb:if>
Open the bbcode_html template and find:
HTML Code:
<div class="bbcode_description">{vb:rawphrase html_code}:</div>
add this below:
HTML Code:
<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />
In the same template add above the last </div> :
HTML Code:
</vb:if>
Now Open the bbcode_php template and find:
HTML Code:
<div class="bbcode_description">{vb:rawphrase php_code}:</div>
add this below:
HTML Code:
<vb:if condition="$show['guest']">
<pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<vb:else />
In the same template add above the last </div> :
HTML Code:
</vb:if>
LIVE DEMO

Screenshots

File Type: jpg hide_codes.jpg (73.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-29-2012, 04:39 AM
gendhenk gendhenk is offline
 
Join Date: May 2012
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


why error?
I admin,no guest
please help my
Reply With Quote
  #23  
Old 02-01-2013, 04:23 PM
faisaly.com faisaly.com is offline
 
Join Date: Mar 2007
Posts: 226
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hope someone can help with this, I tried using vb4.2 and failed! will this hide custom bbcodes?
Reply With Quote
  #24  
Old 02-18-2013, 12:53 PM
neya's Avatar
neya neya is offline
 
Join Date: Jan 2013
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Been looking for this, thanks a bunch, tagged for now, will install later.

Quote:
Originally Posted by faisaly.com View Post
hope someone can help with this, I tried using vb4.2 and failed! will this hide custom bbcodes?
Yep, I just tried it and it failed to work. Using 4.2
Reply With Quote
  #25  
Old 03-11-2013, 08:18 PM
fxdigi-cash fxdigi-cash is offline
 
Join Date: Jul 2012
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know why this code doesn't function well, but maybe we can reverse the method.... instead of assigning a condition against the "guest", we can assign a condition for members only....

we will use the same steps the coder did, as the following:

Open the bbcode_code template and find:
PHP Code:
<div class="bbcode_description">{vb:rawphrase code}:</div
and insert below it:
PHP Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)"
and will do the same to the rest of the codes....

meaning instead of adding this code:
PHP Code:
<vb:if condition="$show['guest']">
<
pre class="bbcode_code">{vb:rawphrase hide_code}</pre>
<
vb:else /> 
we will add this code for the allowed user groups:
PHP Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)"
save the changes in each template and see whether it works or not...logically, it should work, but didn't test it...
Reply With Quote
  #26  
Old 03-25-2013, 03:40 AM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^this worked thanks!
Reply With Quote
  #27  
Old 04-04-2013, 02:25 PM
MissKalunji's Avatar
MissKalunji MissKalunji is offline
 
Join Date: Aug 2003
Location: Canada
Posts: 2,845
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I take that back, it does work but when a post was JUST posted....the link shows until I edit the post and save, only then the please register appears.

Has anyone experienced this issue?
Reply With Quote
  #28  
Old 07-04-2014, 06:23 PM
semaster semaster is offline
 
Join Date: Apr 2012
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can anyone make this work properly ? i really need this.
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:29 PM.


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.04916 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
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
  • (9)bbcode_html
  • (4)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete