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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2005, 03:05 PM
2shae 2shae is offline
 
Join Date: Apr 2005
Location: ireland
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
Reply With Quote
  #2  
Old 09-04-2005, 03:24 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
    }

Reply With Quote
  #3  
Old 09-04-2005, 04:12 PM
2shae 2shae is offline
 
Join Date: Apr 2005
Location: ireland
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so i just change ['userid'] to ['1']
to hide from guests?
Reply With Quote
  #4  
Old 09-04-2005, 04:13 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change nothing.
Reply With Quote
  #5  
Old 09-06-2005, 04:23 PM
2shae 2shae is offline
 
Join Date: Apr 2005
Location: ireland
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 09-06-2005, 05:44 PM
stinger2's Avatar
stinger2 stinger2 is offline
 
Join Date: Jul 2005
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this for vb 3.5 RC2.or am i missing some thing? we tried this but it did not work??
Reply With Quote
  #7  
Old 09-06-2005, 05:48 PM
2shae 2shae is offline
 
Join Date: Apr 2005
Location: ireland
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 09-06-2005, 06:11 PM
stinger2's Avatar
stinger2 stinger2 is offline
 
Join Date: Jul 2005
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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......
Reply With Quote
  #9  
Old 09-06-2005, 06:24 PM
2shae 2shae is offline
 
Join Date: Apr 2005
Location: ireland
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the one i did should only show to admins 8-|
Reply With Quote
  #10  
Old 09-07-2005, 07:22 AM
stinger2's Avatar
stinger2 stinger2 is offline
 
Join Date: Jul 2005
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
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 02:21 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.04832 seconds
  • Memory Usage 2,252KB
  • Queries Executed 11 (?)
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
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete