I'm trying to get the Cybtopstats to show on a non-vb page in an MkPortal CMS. I understand its difficult (perhaps impossible) to get the stats to show on a portal. I can get the stats to show on a normal, non-vb page, just not in my portal.
So in learning/playing, I wanted to see about returning the stats information from a function, but am getting an error of:
Fatal error: Call to a member function query_first_slave() on a non-object in C:\wamp\www\mkportal\forum\includes\functions.php on line 1319
And this is the entire php page/function at the moment. I really have no idea what would be causing the error. I'm not connecting or changing to different DB's or anything as I saw could be a cause for this error.
PHP Code:
function teststats()
{
$cwd = getcwd();
chdir("../../forum/"); //Path from Mkportal blocks
//chdir("./forum/"); //Path from mkportal index
require_once('global.php');
chdir($cwd);
$stats = $cybtopstats;
return $stats;
}
$test = teststats();
echo $test;