View Full Version : Parsing BBcode in 3.6.5
brakken
07-19-2008, 07:08 AM
<a href="https://vborg.vbsupport.ru/archive/index.php/t-82693.html" target="_blank">https://vborg.vbsupport.ru/archi...p/t-82693.html</a>
When I run the text through this code it returns it unformatted. When I try to include global.php from ./forums the entire vbulletin crashes. Is there a new way to parse the bbcode, html, etc ... data in v3.6.5?
Thanks in Advance,
brakken
Opserty
07-19-2008, 08:19 AM
Post the code you are using. Are you trying to parse the BBCode in a file which is not in the /forums directory?
brakken
07-19-2008, 09:27 AM
$text = '[ url = http://www.tehskeen.com]tehskeen[ / url ]';
require_once(DIR . '/global.php');
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parsed_text = $parser->do_parse($text, $do_html, $do_smilies, $do_bbcode, $do_imgcode, $do_nl2br, $cachable);
echo $parsed_text;
I spaced the URL tag so it would not be parsed here.
Output is same as input - it doesn't get parsed. I am running the PHP code as a script in a content block in vbportal, but I checked the paths with the DIR statement and they are correct.
Opserty
07-19-2008, 09:49 AM
You need to set the variables $do_xxxx
The easiest way is just to replace them with true/false. Like so:
$parsed_text = $parser->do_parse($text, false, true, true, true, true, true);
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.