Hate to bump an old thread, but I'm in exactly the same boat. I want to pull posts from my vBulletin to my frontsite; the self-authored PHP script I'm using is in / and my vBulletin is in /forums/
I've already written all of the code necessary to display forum posts from my news forum as news updates, the only things that I haven't got working are parsing BB code and newlines and truncating long posts.
I've tried the code posted in this thread and a few other variants.
Code:
require_once(DIR . '/includes/class_bbcode.php');
says that /DIR/includes/class_bbcode.php does not exist. No, I did not enclose DIR in quotes. I've tried it both adding /forums to the beginning and chdir'ing to forums.
Code:
require_once('./includes/class_bbcode.php');
This at least finds the file (as does using the FQDN), if I chdir to my /forums directory (and hopefully remember to chdir back after!) -- BUT! all it does is throw up an error:
Code:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /(elided)/forums/includes/class_bbcode.php on line 166
include()ing global.php also throws an error:
Code:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /(elided)/forums/includes/class_bootstrap.php on line 26
An attempt to require_once class_bbcode in a global scope functions, but if I try to instantiate a new vB_BbCodeParser in a while loop, I get
Code:
Fatal error: Cannot instantiate non-existent class: vb_bbcodeparser in /(elided)/main.php on line 135