PDA

View Full Version : external php parse bb code


nhatrang
08-06-2007, 06:37 AM
Hi guys,

currently, I'm writing sql queries to bring out pagetext from postid's... However, it has bb code in it... How can I parse bb code with an external php file?

Any kind of help would be appreciated!

Thank you so much in advance.

Dismounted
08-06-2007, 06:39 AM
Look for the tutorial "Adding Editor". You can take out the part where it parses the BB Code.

nhatrang
08-06-2007, 06:43 AM
where is the tutorial located? here? or vbulletin.com?

Dismounted
08-06-2007, 06:47 AM
If you searched here anyway, you'd find it. I dug it out for you since I'd waste more time if I had to keep coming back.
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$message = $parser->do_parse($message, false, true, true, true, true, false);

nhatrang
08-06-2007, 06:52 AM
Thank so much! Can I give you a thank you hug?

weird, this is what I got in return:

Fatal error: Class 'vBulletinHook' not found

Dismounted
08-06-2007, 06:56 AM
Have you included the backend (global.php)?

nhatrang
08-06-2007, 07:00 AM
sorry, I didn't know I was supposed to... You know, i find it very tough to include these files when the php files is in a whole seperate directory... what is your recommendation on doing this when your vb directory is is /news and your php files are in /files...

after adding global.php to the mix, I get init.php requirements, but that is configured inside global.php...

Dismounted
08-06-2007, 07:05 AM
You need to chdir() to the forum directory, require the files, then chdir() back to the current one.

nhatrang
08-06-2007, 07:31 AM
thank you so much!

nhatrang
08-22-2007, 01:15 AM
is there anyway we can specify the bbcode to a set attachment/image width to display? in the forum it can display as big as it want, but with external pages, we can limit it to 400px?

nhatrang
12-18-2007, 04:55 AM
Ok, biggest problem after a few months:

The reason I'm doing this is even people without being a forum member (guests) can even view the pulled contents, however, this is what I'm getting:

Unable to add cookies, header already