vb.org Archive

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

ragtek 02-14-2007 06:16 PM

parsing class
 
i wish to parse just urls in the shoutbox
my code looks like this:
PHP Code:

$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletin,array('no_option' => array('url'=> array('callback' => 'handle_bbcode_url''strip_empty' => true), 'option' => array('url' => array('callback' => 'handle_bbcode_url''strip_empty' => true)), false))); 

but it doesn't work

can someone help pls?

King Kovifor 02-14-2007 06:18 PM

Quote:

Originally Posted by ragtek (Post 1182601)
i wish to parse just urls in the shoutbox
my code looks so:
PHP Code:

$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletin,array('no_option' => array('url'=> array('callback' => 'handle_bbcode_url''strip_empty' => true), 'option' => array('url' => array('callback' => 'handle_bbcode_url''strip_empty' => true)), false))); 

but it wount work

can someone help pls?

why $vbulletin->vbshout_parse. Wouldn't you have to define that in the class file using var $vbshout_parse;

ragtek 02-14-2007 07:18 PM

it looked so in the original file:

PHP Code:

$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletinfetch_tag_list()); 

now someone told to change it into:
PHP Code:

$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletin,array('no_option' => array('url'=> array('callback' => 'handle_bbcode_url''strip_empty' => true), 'option' => array('url' => array('callback' => 'handle_bbcode_url''strip_empty' => true)), false))); 


Adrian Schneider 02-14-2007 07:28 PM

Is there a specific reason you are only including certain tags? Using fetch_tag_list() as the second param is the 'norm.

I also don't see you actually parsing the string. You are only creating the parser.

ragtek 02-14-2007 07:34 PM

In the settings i can de/activate
Quote:

Allow users to use vBCode/Smilies within their shouts
But i don't need smilies,images and other things, so this is set on off i just need urls

this is the function:

PHP Code:

    if ($vbulletin->options['shout_bbcode'])
    {
    return 
$vbulletin->vbshout_parse->parse(convert_url_to_bbcode($text), 'nonforum');
    }
    else
    {
        return 
$text;
    } 

if is set on it parse else it return $text

sorry that i post it here but in the other vbshout threads is a chaos, so i hope i find here help


All times are GMT. The time now is 10:27 PM.

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.01444 seconds
  • Memory Usage 1,735KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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