Topic: Punbb, Movabletype and smarty

I know how to integrate my website with punbb by using

define('PUN_ROOT', '/home/erinther/public_html/pluss/user/');
require PUN_ROOT.'include/common.php';

but now I use dynamic publishing templates with my MT-based website. When I add the code, then I get this error:

Fatal error: Call to a member function on a non-object in /home/erinther/public_html/forum/include/functions.php on line 110

That is

$result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
    if (!$db->num_rows($result))

Has anybody any idea what is wrong?

Re: Punbb, Movabletype and smarty


Global $db;

at the top of your function where that error occurs

Re: Punbb, Movabletype and smarty

People have been complaining about similar types of things before hmm
This is in PunBB's functions.php, $db is properly globalized.

Have you edited the common_db.php file at all? Or any of the database related files? Or functions.php?

Re: Punbb, Movabletype and smarty

Or here's another question: is common.php being required from within a function?

Re: Punbb, Movabletype and smarty

No I have nor edited common_db.php nor common.php is required from within a function!