Jump to content
  • 0

Error in Flux CP


Haku

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   2
  • Joined:  12/04/13
  • Last Seen:  

This errors:

Notice: Trying to get property of non-object in /home/samers1/public_html/pegasus/themes/default/main/status.php on line 49

Notice: Trying to get property of non-object in /home/samers1/public_html/pegasus/themes/default/main/status.php on line 50

Fatal error: Call to a member function getStatement() on a non-object in /home/samers1/public_html/pegasus/themes/default/main/status.php on line 50

Line 50 marked " /* line 50 */" status.php:

<?php if (!defined('FLUX_ROOT')) exit;
$cache = FLUX_DATA_DIR.'/tmp/ServerStatus.cache';

if (file_exists($cache) && (time() - filemtime($cache)) < (Flux::config('ServerStatusCache') * 600)) {
    $serverStatus = unserialize(file_get_contents($cache));
}
else {
    $serverStatus = array();
    foreach (Flux::$loginAthenaGroupRegistry as $groupName => $loginAthenaGroup) {
        if (!array_key_exists($groupName, $serverStatus)) {
            $serverStatus[$groupName] = array();
        }

        $loginServerUp = $loginAthenaGroup->loginServer->isUp();

        foreach ($loginAthenaGroup->athenaServers as $athenaServer) {
            $serverName = $athenaServer->serverName;

            $sql = "SELECT COUNT(char_id) AS players_online FROM {$athenaServer->charMapDatabase}.char WHERE online > 0";
            $sth = $loginAthenaGroup->connection->getStatement($sql);
            $sth->execute();
            $res = $sth->fetch();

            $serverStatus[$groupName][$serverName] = array(
                'loginServerUp' => $loginServerUp,
                'charServerUp' => $athenaServer->charServer->isUp(),
                'mapServerUp' => $athenaServer->mapServer->isUp(),
                'playersOnline' => intval($res ? $res->players_online : 0)
            );
        }
    }
    
    $fp = fopen($cache, 'w');
    if (is_resource($fp)) {
        fwrite($fp, serialize($serverStatus));
        fclose($fp);
    }

}
$online = "<img src=" . $this->themePath('img/online.jpg') . " />";
$offline = "<img src=" . $this->themePath('img/offline.jpg') . " />";

 $info  = array(
         'accounts'   => 0,
         'character'   => 0
 );

// Accounts.
 $sql = "SELECT COUNT(account_id) AS total FROM {$server->loginDatabase}.login ";
 /* line 50 */ $sth = $server->connection->getStatement($sql);
 $sth->execute();
 $info['accounts'] += $sth->fetch()->total;


//Highest Peak Table
 $hp = Flux::config('FluxTables.HighestPeak');

 $sql = "SELECT num_users,peak_date FROM {$server->loginDatabase}.$hp LIMIT 1";
 $sth = $server->connection->getStatement($sql);
 $sth->execute();

 $hp = $sth->fetchAll();

?>

Can someone help me ?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

As that's not a default theme you're using, i'd suggest getting in contact with the person who designed it and ask them politely to solve problems with their theme.

Link to comment
Share on other sites

×
×
  • Create New...