vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to hide contents of CODE for unregistered users (https://vborg.vbsupport.ru/showthread.php?t=152500)

d3v1L 07-17-2007 09:02 AM

How to hide contents of CODE for unregistered users
 
How to hide contents of CODE for unregistered users for vb 3.6.7

Atakan KOC 07-17-2007 10:54 AM

bbcode_code

replace

PHP Code:

<if condition="is_member_of($bbuserinfo, 1)">
<
div style="margin:20px; margin-top:5px">
    <
div class="smallfont" style="margin-bottom:2px">$vbphrase[code]: <a href="register.php$session[sessionurl_q]rel="nofollow">$vbphrase[register]</a></div>
    <
pre class="alt2" dir="ltr" style="
        margin: 0px;
        padding: 
$stylevar[cellpadding]px;
        border: 1px inset;
        width: 
$stylevar[codeblockwidth];
        height: 
{$blockheight}px;
        text-align: left;
        overflow: auto"
><a href="register.php$session[sessionurl_q]rel="nofollow">Please Register</a></pre>
</
div>
<else />
<
div style="margin:20px; margin-top:5px">
    <
div class="smallfont" style="margin-bottom:2px">$vbphrase[code]:</div>
    <
pre class="alt2" dir="ltr" style="
        margin: 0px;
        padding: 
$stylevar[cellpadding]px;
        border: 1px inset;
        width: 
$stylevar[codeblockwidth];
        height: 
{$blockheight}px;
        text-align: left;
        overflow: auto"
>$code</pre>
</
div>
</if> 


d3v1L 07-18-2007 01:35 PM

Hi, thanks for the code. i think you forgot to add </div> before <else /> :)

Edited

Donno whats the issue , some times registered members can view code sometimes they cant :(
pl help

EnIgMa1234 07-18-2007 02:07 PM

Have you reproduced this yourself?

d3v1L 07-18-2007 08:42 PM

Quote:

Originally Posted by EnIgMa1234 (Post 1294645)
Have you reproduced this yourself?

Dont knw what you mean but the issue is strange. just nw i posted a message in my forum and used the code tags and i logged out to view the post again. And i was able to see the content .. sigh.

Adrian Schneider 07-18-2007 08:44 PM

The problem is with post caching. Caches are style specific, but not usergroup specific.

d3v1L 07-18-2007 08:51 PM

can something be done abt it?

Adrian Schneider 07-18-2007 08:59 PM

I made a mod that does this a while ago, but it was a bit of a "hack" so to speak. Whenever "[code]" or "[php]" (etc) was encountered in a post, it would set the cachable variable to false, and then the template condition would work as expected.

d3v1L 07-18-2007 09:16 PM

May i please know where what is the name of hack or where can i find it?


All times are GMT. The time now is 06:45 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.01199 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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