Alright, I'm trying to create an external vB page so I can parse the BBCode in the news articles that get posted, but I'm having no luck.
The PHP code I have is (at the top of the page):
PHP Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT', 'index');
define('FWD', '/home/tgaming/trickgaming.org/forum');
define('BWD', (($getcwd = getcwd()) ? $getcwd : '.'));
$phrasegroups = array();
$specialtemplates = array();
$globaltemplates = array();
$actiontemplates = array();
chdir(FWD);
require_once('./global.php');
chdir(BWD);
?>
Then a bunch of irrelevant stuff, and then further down:
PHP Code:
<?php
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;
$forumid = 2;
$newslimit = 5;
$query_sel_news = $db->query_read("SELECT * FROM thread WHERE forumid='$forumid' ORDER BY threadid DESC LIMIT {$newslimit}");
while ($r = $db->fetch_array($query_sel_news))
{
$title = $row['title'];
$date = $row['dateline'];
$username = $row['postusername'];
$threadid = $row['threadid'];
$firstpostid = $row['firstpostid'];
$views = $row['views'];
$replies = $row['replycount'];
$query_sel_news = $db->query_read("SELECT * FROM post WHERE postid='$dfirstpostid'");
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
);
include ('inc/news.php');
}
}
$db->free_result($query_sel_news);
$db->close();
?>
However, this gives me the errors:
Code:
Fatal error: Call to a member function query_read_slave() on a non-object in /home/.cessie/tgaming/trickgaming.org/forum/includes/class_bbcode.php on line 198
Fatal error: Call to a member function unlock_tables() on a non-object in /home/.cessie/tgaming/trickgaming.org/forum/includes/functions.php on line 4680
I'm running 3.6.0 B3, and I'm pretty sure the code was written for 3.5.3, but I don't see anything that should have changed since then. Any help?