brsy
nah mang
- May 12, 2011
- 1,530
- 272
Okay, so this was working earlier, but it just seemed to stop working. Here is the codes and the error:
class.engine.php
class.tpl.php
Error
Line 34 is the line where I setParam('online', $engine->onlineUsers());
class.engine.php
PHP:
public function onlineUsers() {
return mysql_result(mysql_query("SELECT users_online FROM server_status LIMIT 1"), 0);
}
class.tpl.php
PHP:
public function __construct() {
global $users, $db, $config, $engine;
$this->setParam("hotelName", $config['hotel']['name']);
$this->setParam("url", $config['hotel']['url']);
$this->setParam("skin", $config['hotel']['skin']);
$this->setParam('build', $config['server']['build']);
$this->setParam('facebook', '393566863990169');
$this->setParam('online', $engine->onlineUsers());
}
Error
Fatal error: Call to a member function onlineUsers() on a non-object in C:\xampp\htdocs\class\class.tpl.php on line 34
Line 34 is the line where I setParam('online', $engine->onlineUsers());