PDA

View Full Version : vbulletin shuts down when parsing bbcode


KaitenV
06-27-2013, 05:42 PM
For some reason vbulletin 4.2.1 shuts down when trying to parse bbcode on an external page. I did not have these problems with 3.8.7, and it's too late to downgrade. Please help.

$forumpath = SRD."/forums"; // path to your forum
$that_cwd = @getcwd(); // absolute path to this script
chdir($forumpath);
$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();
require_once('./global.php');
require_once(DIR . '/includes/class_bbcode.php');
@chdir($that_cwd);
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list(), true);
$my_text = $bbcode_parser->do_parse("Parse",false,true,true,true,true,false);

echo $my_text;

The message it gives is:

vBulletin Message
Unable to add cookies, header already sent.
File: /home/mangahut/public_html/includes/news/vbulletin2.php(8) : eval()'d code
Line: 1
Otaku Helpers Forums


The forums should not show up at all, it should just import the functions and parse text.

kh99
06-27-2013, 07:06 PM
Is that the entire code from the file news/vbulletin2.php? It looks like the error is saying that some part of the script has already output some text before global.php is called (which tries to set headers, but it can't).

KaitenV
06-27-2013, 08:38 PM
I fixed it by changing display errors to 0. Thanks for your reply though. It took me hours to correct this script.