View Full Version : How to use full BBcode-parsing in custom pages?

04 May 2010, 20:08
Hey there,

i've written my own news-page which is getting it's news out of a specific forum with some additional things like prefixid etc. through my own modified external.php.
Works like a charm, the only thing that's missing is some bbcode-tags. Everything works (also img-tags), except smiley and attachment-parsing. Emoticons are just drawn the normal way ( : ) instead of the smiley :) ). Attachments work if I click on them, but no thumbnail is drawn, just "Attach 832" is written on the position of the image.

My question is: how do i parse random content with the full bbcode-support?

require_once(DIR . '/includes/class_postbit.php');
require_once(DIR . '/includes/class_bbcode.php');
$thread['attachments'] =& $attachmentcache["$thread[postid]"];
$postbit_factory = new vB_Postbit_Factory();
$postbit_factory->registry =& $vbulletin;
$postbit_factory->bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list($vbulletin->options['bburl'] . '/'));
$postbit_factory->thread =& $thread;
$postbit_factory->cache = array();
$postbit_obj =& $postbit_factory->fetch_postbit('external');
$message = $postbit_obj->construct_postbit($thread);
$xml->add_tag('content', $message);

I think it propably is the "fetch_postbit('external')" but i can't find another solution to parse only the content of the post with bbcode.