开发者

vBulletin BBCode on external page

开发者 https://www.devze.com 2022-12-23 19:23 出处:网络
I integrated my vBulletin with custom front page. I\'m wondering, how could I use vBulletin BBcode on tha开发者_运维知识库t page (I\'m displaying some posts there).

I integrated my vBulletin with custom front page. I'm wondering, how could I use vBulletin BBcode on tha开发者_运维知识库t page (I'm displaying some posts there).

Any suggestions?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消