Log in

View Full Version : parsing class


ragtek
02-14-2007, 06:16 PM
i wish to parse just urls in the shoutbox
my code looks like this:
$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
i wish to parse just urls in the shoutbox
my code looks so:
$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:

$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
now someone told to change it into:
$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 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:

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