FWIW, my problem with not being logged in is fixed by calling "print_ouput" instead of "echo". I put my test program in another directory and added the chdir:
PHP Code:
<?php
chdir('/home/???/forum');
require_once('./global.php');
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = "[noparse][color=red]some text with tags[/color][/noparse]";
$html = $bbcode_parser->parse($text);
print_output($html);
?>
Still works OK.
Maybe you just need a "global $vbulletin;" in your maintext()? (but you didn't have it in a function before, so maybe not...)
--------------- Added [DATE]1259002914[/DATE] at [TIME]1259002914[/TIME] ---------------
Something else that maybe should be mentioned (for future reference if not for burn4cid) - there are other php BBCode parsing functions available out there, if you don't need to specifically use the vBulletin codes.