vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How do I hide the code box from guests? (https://vborg.vbsupport.ru/showthread.php?t=316679)

HM666 01-15-2015 05:51 AM

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?

MarkFL 01-15-2015 06:29 AM

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>

HM666 01-15-2015 08:06 AM

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>


HM666 02-29-2016 10:25 AM

1 Attachment(s)
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.

MarkFL 02-29-2016 11:53 AM

I would guess the CSS might have to be adjusted for the CMS.

HM666 02-29-2016 06:15 PM

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*

MarkFL 02-29-2016 07:01 PM

If you can post a link to a page where it occurs, I will see if I can figure out a solution. :)

HM666 02-29-2016 08:54 PM

I would but now it seems to not be doing it. Maybe one of the things I did worked.....eventually LOL.


All times are GMT. The time now is 06:30 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.01029 seconds
  • Memory Usage 1,730KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete