The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Parse BBCode
Hello,
I am currently trying to syndicate news from a certain forum. Take a look at my script (yes, I do have my own db class): PHP Code:
|
#2
|
|||
|
|||
You basically need to make a vB page out of your non-vB page. Here is an outline. Hope it helps.
Code:
<?php error_reporting(E_ALL & ~E_NOTICE); define('THIS_SCRIPT', 'whatever'); // SET ME define('FWD', '/full/server/path/to/forum'); // SET ME define('BWD', (($getcwd = getcwd()) ? $getcwd : '.')); $phrasegroups = array(); $specialtemplates = array(); $globaltemplates = array(); $actiontemplates = array(); chdir(FWD); require_once('./global.php'); chdir(BWD); require_once(DIR . '/includes/class_bbcode.php'); $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $do_html = false; $do_smilies = true; $do_bbcode = true; $do_imgcode = true; $do_nl2br = true; $cachable = false; $query_sel_news = $db->query_read("QUERY HERE"); // SET ME while ($r = $db->fetch_array($query_sel_news)) { $pagetext = $parser->do_parse( $r['pagetext'], $do_html, $do_smilies, $do_bbcode, $do_imgcode, $do_nl2br, $cachable ); echo $pagetext . '<br /><br />'; // SET ME } $db->free_result($query_sel_news); $db->close(); ?> |
#3
|
|||
|
|||
Thanks so much!
However, the vBulletin template is pulled up and the 'pagetext' still isn't outputted. How do I get it so it just... a page, with the news pulled up (without the vB template). I defined THIS_SCRIPT as 'news_index' so, do I need to set up a template or file for news_index somewhere? Sorry, never done anything like this with vB! Thanks so much, I truly do appreciate it. EDIT: Wait, the "vB template" that I am referring to is the "board offline" page. Whenever I login as admin (so I can view the forums and don't get the nasty offline error), I can view the page, but it spits an error out: Quote:
|
#4
|
|||
|
|||
Try the following:
Code:
replace: $db-> with: $vbulletin->db-> |
#5
|
|||
|
|||
Didn't do anything... I suspected that I shouldn't because I have my own DB class.
|
#6
|
|||
|
|||
Agreed, try replacing the vB query_read with your class equivalent.
|
#7
|
|||
|
|||
In class_bbcode.php? Where?
|
#8
|
|||
|
|||
If your DB class is for the same database where vB is located, it might just be easier to be rid of your class. Otherwise you can try a class_bbcode.php file edit, replacing query_read with just query, but if you are going to file edit, then maybe set a constant in your script, and then file edit the vB script, so that for your script $db->query is used and for vB, it uses what it uses.
|
#9
|
|||
|
|||
Okay, I edit line 472... it READ (past tense):
PHP Code:
PHP Code:
|
#10
|
|||
|
|||
If that's the only file edit you made, then it should be fine as vB also can do a $db->query that acts like a $db->query_read when SELECT is in the query.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|