This should be all you need;
PHP Code:
/*
Include and call the bbcode class
*/
require_once(DIR . '/includes/class_bbcode.php');
$bbcode =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
/*
An example of using the class to parse data that contains bbcode
*/
$text = 'Some text [b]with bbcode[/b] in it';
/* $forumid can be set to;
- 'calendar' (follows bbcode rules for the calendar)
- 'privatemessage' (follows bbcode rules for PMs)
- 'usernote' (follows bbcode rules for usernotes)
- 'signature' (follows bbcode rules for signatures)
- 'nonforum' (follows "global" bbcode rules as defined in vBoptions)
- 'announcement' (follows bbcode rules for announcements)
- 'Any vaild forumid' (example; 1, 2, 17, etc). Will follow bbcode rules for specified forumid. The array "$forum" must be defined and the function "fetch_foruminfo" must be defined for this to work.
*/
$forumid = 'nonforum'; // just to make things simple..;0
$allowsmilie = true; // parse smilies? true = yes, false = no.
// ## The code below will convert the bbcode to html using the rules above.
$parsed_text = $bbcode->parse($text, $forumid, $allowsmilie);