The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
bb-codes on external page
Hi,
Im making a site with a vbulletin forum attached, but topics for a specified forum are displayed on the site as news. But i need a way to convert the BB-codes from the database. Is there some sort of code of script i can use or can i attach a script forum vbulletin it self Greetings burn |
#2
|
|||
|
|||
Something like this?
Code:
require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $text = "[color=red]some text with tags[/color]"; $html = $bbcode_parser->parse($text); |
#3
|
|||
|
|||
i have this:
PHP Code:
but then i recieve this error: Quote:
|
#4
|
|||
|
|||
Hmm...I tried this:
Code:
<?php require_once('./global.php'); require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $text = "[color=red]some text with tags[/color]"; $html = $bbcode_parser->parse($text); echo $html; ?> In a .php file in the forum directory, but it only works when I'm logged in and the cookies have already been set. Maybe someone else can tell us what's going on... (stuff deleted because none of it made sense...) |
#5
|
|||
|
|||
im not working in the same folder, and its not supposed to be logged in.
Im working form a other subdomain. PHP Code:
|
#6
|
|||
|
|||
FWIW, my problem with not being logged in is fixed by calling "print_ouput" instead of "echo". I put my test program in another directory and added the chdir:
PHP Code:
Maybe you just need a "global $vbulletin;" in your maintext()? (but you didn't have it in a function before, so maybe not...) --------------- Added [DATE]1259002914[/DATE] at [TIME]1259002914[/TIME] --------------- Something else that maybe should be mentioned (for future reference if not for burn4cid) - there are other php BBCode parsing functions available out there, if you don't need to specifically use the vBulletin codes. |
#7
|
|||
|
|||
OMG you r right $vbulletin needs to be added global
ty |
#8
|
|||
|
|||
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'); Code:
require_once('./includes/class_bbcode.php'); 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 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 Code:
Fatal error: Cannot instantiate non-existent class: vb_bbcodeparser in /(elided)/main.php on line 135 |
#9
|
|||
|
|||
Start by checking the following 2 conditions:
- You must chdir() to the vBulletin installation directory before calling any of the vBulletin scripts. - global.php should be the first to be included. |
#10
|
|||
|
|||
Quote:
(ETA: I was in the middle of writing my post when Marco posted - you should probably just follow his instructions) |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|