so I am trying to include this file from punbb inside the template of coppermine photo gallery:
define('PUN_ROOT', '../punbb/'); include '../punbb/include/common.php';
you have to define PUN_ROOT to include common.php in case you were wondering.
Now if I include this code in a blank php file it runs fine and I am able to use any of the functions in common.php and more importantly functions.php which is an include in common.php.
So there is no problem with the doing the above code when not inside coppermine.
Also the place in the coppermine theme file i am putting this is the recommended place for including custom php inside coppermine...and other php code I have put in the same place runs fine.
But...what happens when I put the above code in my coppermine template is this:
Fatal error: Call to a member function on a non-object in C:\Program Files\xampp\htdocs\punbb\include\functions.php on line 112
now this is line 112 of functions.php:
$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 u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error());
The problem is the $db->query bit. $db has been defined as global so that is not the problem...and if I remove everything in the brackets i get the same error so I have narrowed it down to the $db->query bit being the problem.
So my question is...what are all the possible reasons that could be stopping me from running $db->query() inside of my coppermine template.
I am not expecting anyone to give me program specific help...just the general reasons that could be causing this error.
Thankyou in advance for all help