Question

I integrated my vBulletin with custom front page. I'm wondering, how could I use vBulletin BBcode on that page (I'm displaying some posts there).

Any suggestions?

Was it helpful?

Solution

It's probably best to just use the BBCode parser from vBulletin itself. It's relatively easy to use, here's an example:

require_once('global.php');
require_once('includes/class_bbcode.php');

$parser = new vB_BbCodeParser($vbulletin, fetch_tag_list());
$text = $parser->parse('[B][I]text[/I][/B]');
print $text;

You may need to play games with chdir to include global.php from somewhere outside the vBulletin tree, but I'm sure you've had to do that for other integration anyway. :)

There are way of restricting the tags too, just have a rummage around class_bbcode.php and you'll see some fairly obvious places to start.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top