vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   hide code (https://vborg.vbsupport.ru/showthread.php?t=95635)

2shae 09-04-2005 02:05 PM

hide code
 
ok i tried and failed badly at making a code to hide text from guests
i run rc2

i tried this
if(preg_match([hideg],
$this->post['message']))
{
$this->post['message'] = preg_replace([hideg], '<if condition="$bbuserinfo['usergroupid'] != in_array($bbuserinfo[usergroupid],array(1))"> '$this->post['message']);
}
just gave me a lot of errors at the start
any ideas
i want to have the code [hideg][/hideg]
i tried with a bbcode but it just didnt work :ermm:

Andreas 09-04-2005 02:24 PM

Try this (untested)

bbcode_create
PHP Code:

$this->tag_list['no_option']['hideg']['callback'] = 'handle_external';
$this->tag_list['no_option']['hideg']['external_callback'] = 'handle_bbcode_hideg';
$this->tag_list['no_option']['hideg']['strip_empty'] = true;

if (!
function_exists('handle_bbcode_hideg'))
{
    function 
handle_bbcode_hideg(&$parser$text)
    {
        
$parser->options['cachable'] = false;
        if (!
$parser->registry->userinfo['userid'])
        {
            return 
'';
        }
        return 
$text;
    }



2shae 09-04-2005 03:12 PM

so i just change ['userid'] to ['1']
to hide from guests?

Andreas 09-04-2005 03:13 PM

Change nothing.

2shae 09-06-2005 03:23 PM

HTML Code:

$this->tag_list['no_option']['hidea']['callback'] = 'handle_external';
$this->tag_list['no_option']['hidea']['external_callback'] = 'handle_bbcode_hidea';
$this->tag_list['no_option']['hidea']['strip_empty'] = true;

if (!function_exists('handle_bbcode_hidea'))
{
    function handle_bbcode_hideg(&$parser, $text)
    {
        $parser->options['cachable'] = false;
        if (!$parser->registry->userinfo->usergroup['6'])
        {
            return $text;
        }
        return '';
    }

would that code only show the contents of [hidea] to people in group 6?
ps the hide from guests worked perfectly thanks

stinger2 09-06-2005 04:44 PM

is this for vb 3.5 RC2.or am i missing some thing? we tried this but it did not work??

2shae 09-06-2005 04:48 PM

rc2 put it in plugins under bbcode_create
i want to see does it work
im not trying lol
i lost my test board yesterday due to a bad code i made

stinger2 09-06-2005 05:11 PM

it worked........me and my friend SEZ just tried it...on a test forum and its like a charm .............its a very easy hide link for unregisterd .....many thanks 2shae and kirbyDE......

2shae 09-06-2005 05:24 PM

the one i did should only show to admins 8-|

stinger2 09-07-2005 06:22 AM

no what we did is exactly as kidrbyDE wrote...and its ONLY for unrigesterd members....
and it works great..

@kirbyDE.........from all the hide links we tried ....non worked..because the old ones used files NOT available in VB 3.5 RC2

why dont you releas this as an new hack.....for it..and if you can add to it so that it shows

links visible for registerd user......phrase to appeare ....it would be a complet hide link from unrigestered..

i really would like this one to be added to your name KirbyDE
rgds


All times are GMT. The time now is 03:09 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.02242 seconds
  • Memory Usage 1,734KB
  • 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_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete