Quote:
Originally Posted by King Kovifor
To use with BBCode, you must use the BBCode parser class. It's a very simplistic class to use, and you can read more about it here (class -> vB_BbCodeParser).
If you want to parse a variable called $var, you would use this php code:
PHP Code:
require('includes/class_bbcode.php');
[noparse]$var = '[b][i][u]HA HA[/u][/i][/b]'; [/noparse]
$bbcode = new vB_BbCodeParser($vbulletin,fetch_tag_list());
$template_var = $bbcode->do_parse($var);
This will have a fully parse variable from $var into $template_var. You could change any of my variable names if needed.
|
How add tempate to $template_var ?
My output template's name TEST.
This code I add at first srcipt:
Code:
require('includes/class_bbcode.php');
$var = '[b][i][u]HA HA[/u][/i][/b]';
$bbcode = new vB_BbCodeParser($vbulletin,fetch_tag_list());
$template_var = $bbcode->do_parse($var);
It is my last code line:
Code:
while($post = $db->fetch_array($getposts))
{
eval('$mini .= "' . fetch_template('mini') . '";');
}
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEST') . '");');
When I do:
Code:
$mini = $bbcode->do_parse($var);
on the screen display HA HA

any other bbc code example [b][/b] no parse