The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Parsing BBCodes on an external page
Originally taken up in a borrowed thread
Basics: I want to write a script that copies the text of threads from my news forum to my front site. I've hand-coded a mostly-working script from scratch, but I have no idea how to parse BBCodes, so any multiline news posts or posts that contain BBCodes show up as a giant mishmash on the front site. My front site is in / and the forums are in /forums/, so I have to chdir() into forums and back whenever I want to call any vBulletin functionality. Having searched the forums, I've seen code that looks like this: PHP Code:
Problem is, it doesn't work. The other thread in the vB3 forum solved most of the initial issues I had, so I'll leave them out, but now I'm running into some dependency problems. I'm not all that familiar with the internal workings of vBulletin--for that matter, OOP in general is not my forte--so I don't know what classes/methods/functions are where. Here's my current code: PHP Code:
With that code in the while loop, I get the following error: Code:
Fatal error: Call to a member function query_read_slave() on a non-object in /(elided)/forums/includes/class_bbcode.php on line 220 If it matters, the basic structure of my frontsite is as follows frontconfig.php: contains global variables for my code -- nothing relating to vBulletin index.php: Shell HTML page containing the CSS and basic table structure -- a vanilla site with a sidebar containing links and a main page body containing news posts sidebar.php: Links, inserted into index.php with an include() statement main.php: contains some static HTML and my news script. /forums/global.php is include()d at the top of index.php; since main.php is called only from within index.php, it should always include global.php. There's also a "global vbulletin;" statement in index.php which should likewise be inherited into main. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|