The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parsing BBCode to HTML
Hey everyone,
I'm currently pulling the latest posts from one of my forums directly from the database and putting it on my main site (non-vB). However, unsurprisingly, there is a bunch of BBCode mixed within the text (the pagetext column of the post table). How can I parse this BBCode to return HTML? Which vB file must I include and which function should I use? |
#2
|
|||
|
|||
This should be all you need;
PHP Code:
|
#3
|
|||
|
|||
Quote:
However, when I tried to do that, I get this error message: Fatal error: Class 'vBulletinHook' not found in /mnt/w0800/d09/s41/b027ae64/www/forums/includes/class_bbcode.php on line 2347 Looking at the code in class_bbcode.php, it seems to abruptly call on a vBulletinHook without ever declaring it. I'm very new to PHP... What would be the problem here? |
#4
|
||||
|
||||
You'll need to have this above that code:
PHP Code:
|
#5
|
|||
|
|||
Almost seems to work...but still a little error:
$bbcode =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); That line seems to be problematic. I get the following error message: Fatal error: Call to a member function query_read_slave() on a non-object in /mnt/w0800/d09/s41/b027ae64/www/forums/includes/class_bbcode.php on line 198 |
#6
|
|||
|
|||
Can someone please give me the last bit of information I need to get this thing working...?
|
#7
|
|||
|
|||
here's a working sample of it that works in the forum installation directory:
PHP Code:
it should print this: "Some text with bbcode in it" |
#8
|
|||
|
|||
I'm having exactly the same error message :
Fatal error: Call to a member function on a non-object in /path/class_bbcode.php on line 198 I'm trying to acheive the same thing : parsing bbcodes in posts that i am currently displaying outside the forum (non-vb.) my code is : PHP Code:
@Augusto : i tried your test successfully. |
#9
|
|||
|
|||
I am still having a really tough time with pulling this off in 3.6. I continue to get the error:
Fatal error: Call to a member function query_read_slave() on a non-object in /var/www/newspail3/forums/includes/class_bbcode.php on line 213 from outside the forum directory. --------------- Added [DATE]1194608789[/DATE] at [TIME]1194608789[/TIME] --------------- Figured this out. I had these examples embedded within functions. I don't quite understand why they wouldn't work but I assigned $bbcode when I was inside my forum directory PHP Code:
|
#10
|
|||
|
|||
I can confirm the last post. This method does not work when part of a function, which is a big problem when integrating into some existing sites.
This works: PHP Code:
PHP Code:
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|