I have now, but I'm still stuck.....
Quote:
Originally Posted by BirdOPrey5
You need to initialize and use the BB Code parser...
In the php file near the top add the lines:
PHP Code:
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),true);
Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)
PHP Code:
$parsedthread= $bbcode_parser->parse($rawthread ,'nonforum', true);
The "true" on the end is to parse smilies too... if you don't want smilies make it "false".
|
awesome, thanks for helping me out,.. I'm a little stuck at the moment though,.. could you take a look at my test.php page for me- it's still not parsing BBCode,..
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE & ~8192);
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($GLOBALS['vbulletin'], fetch_tag_list(),true);
$parsedthread= $bbcode_parser->parse($rawthread ,'nonforum', true);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'test'); // change this depending on this files name
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('TEST',);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
eval('print_output("' . fetch_template('TEST') . '");');
?>
Using:
PHP Code:
require_once(DIR . '/includes/class_bbcode.php');
Gives me this error:
Quote:
Warning: require_once(DIR/includes/class_bbcode.php) [function.require-once]: failed to open stream: No such file or directory in /forum/test.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'DIR/includes/class_bbcode.php' (include_path='.:/usr/local/php5/lib/php') in /forum/test.php on line 4
|
Using:
PHP Code:
require_once('./includes/class_bbcode.php');
Gives me this error:
Quote:
Fatal error: Class 'vBulletinHook' not found in /forum/includes/class_bbcode.php on line 2463
|
I'm also a little confused on what to do with:
Then you can use this line (change the $rawthread and $parsedthread variables to your needs) to get the parsed output (BB Code converted to HTML)