Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-15-2015, 05:51 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How do I hide the code box from guests?

Hello how do I make it where you HAVE to be registered in order to view the html, php, quote & code boxes like it is here on vb.org? Is there a setting i can set or a mod out there already?
Reply With Quote
  #2  
Old 01-15-2015, 06:29 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One way would be to use a vb conditional in the respective templates. For example in the template "bbcode_code" replace:

HTML Code:
{vb:raw code}
with:

HTML Code:
<vb:if condition="$show['guest']">You must be registered and logged in to view code contents.<vb:else />{vb:raw code}</vb:if>
edit: I now realize you perhaps want to hide the entire boxes, rather than the content. If so then wrap all of the HTML in the templates with:

HTML Code:
 <vb:if condition="$show['member']">Pre-existing template HTML in here</vb:if>
Reply With Quote
Благодарность от:
HM666
  #3  
Old 01-15-2015, 08:06 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah gotcha will give that a try later on after some sleep

--------------- Added [DATE]1421380866[/DATE] at [TIME]1421380866[/TIME] ---------------

Hmmmmmm did not work. It shows this message to everyone not just guests. And there was one that it did not work on at all. One thread/post it worked too well and will not show it to anyone and another thread/post ir did not do anything at all. Here's my code for the bbcode_code template please see if I missed something.

Code:
<div class="code_box_wrapper MHB_wrappers">
	<div class="code_box_description">{vb:rawphrase code}:</div>
	<div class="code_box"><pre id="code_select" class="code_box_text" ondblclick="selectText(this.id)" title="Double-Click To Select All Text."><vb:if condition="$show['guest']">You must be <a href="signup.php">registered</a> and logged in to view code contents.<vb:else />{vb:raw code}</vb:if></pre></div>
</div>
<script type="text/javascript">
	var newid = GetNewId("code_select");
	var el = document.getElementById(newid).parentNode;
	el.style.maxHeight = code_height + 'px';
	maxMinButton(newid,code_height,0);
</script>
Reply With Quote
Благодарность от:
MarkFL
  #4  
Old 02-29-2016, 10:25 AM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Revisiting this, I have noticed that on the CMS I have a problem. The code shows fine elsewhere but on the CMS the "CODE:" part is missing.

The code for my code box is...

Code:
<div class="code_box_wrapper MHB_wrappers">
	<div class="code_box_description">{vb:rawphrase code}:</div>
	<div class="code_box"><pre id="code_select" class="code_box_text" ondblclick="selectText(this.id)" title="Double-Click To Select All Text."><vb:if condition="$show['guest']">You must be <a href="signup.php">registered</a> and logged in to view code contents.<vb:else />{vb:raw code}</vb:if></pre></div>
</div>
<script type="text/javascript">
	var newid = GetNewId("code_select");
	var el = document.getElementById(newid).parentNode;
	el.style.maxHeight = code_height + 'px';
	maxMinButton(newid,code_height,0);
</script>
Any ideas why this is happening only in the CMS? On the forums, the posts are just fine and there are no problems.
Attached Images
File Type: png codescreen.png (5.9 KB, 0 views)
Reply With Quote
  #5  
Old 02-29-2016, 11:53 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would guess the CSS might have to be adjusted for the CMS.
Reply With Quote
  #6  
Old 02-29-2016, 06:15 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah I tried a few adjustments. Its kinda weird and only happens in a few areas of the CMS I noticed upon more inspection. *SIGH*
Reply With Quote
  #7  
Old 02-29-2016, 07:01 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you can post a link to a page where it occurs, I will see if I can figure out a solution.
Reply With Quote
Благодарность от:
HM666
  #8  
Old 02-29-2016, 08:54 PM
HM666's Avatar
HM666 HM666 is offline
 
Join Date: Jan 2014
Location: Little Rock, AR
Posts: 1,060
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would but now it seems to not be doing it. Maybe one of the things I did worked.....eventually LOL.
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 08:08 PM.


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.06310 seconds
  • Memory Usage 2,266KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (3)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete