fix: get the overview page to render

This commit is contained in:
Emmanuel BENOîT 2024-12-31 00:50:29 +01:00
parent f845d05eb5
commit a9ac89ab22
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
29 changed files with 34 additions and 34 deletions

View file

@ -1,4 +1,4 @@
<? <?php
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// LegacyWorlds Beta 5 // LegacyWorlds Beta 5

View file

@ -1,4 +1,4 @@
<? <?php
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// LegacyWorlds Beta 5 // LegacyWorlds Beta 5

View file

@ -1,4 +1,4 @@
<? <?php
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// LegacyWorlds Beta 5 // LegacyWorlds Beta 5

View file

@ -1,4 +1,4 @@
<? <?php
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// LegacyWorlds Beta 5 // LegacyWorlds Beta 5

View file

@ -2,7 +2,7 @@
class beta5_fleet_getStats { class beta5_fleet_getStats {
function beta5_fleet_getStats($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_fleet_getUpkeep { class beta5_fleet_getUpkeep {
function beta5_fleet_getUpkeep($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules'); $this->rules = $this->lib->game->getLib('beta5/rules');

View file

@ -2,7 +2,7 @@
class beta5_forums_getStructure { class beta5_forums_getStructure {
function beta5_forums_getStructure($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
$this->players = $this->lib->game->getLib('beta5/player'); $this->players = $this->lib->game->getLib('beta5/player');
@ -69,7 +69,7 @@ class beta5_forums_getStructure {
// Get alliance forums // Get alliance forums
$ap = $this->alliance->call('getPrivileges', $player); $ap = $this->alliance->call('getPrivileges', $player);
if (count($ap['f_read']) || count($ap['f_mod'])) { if ($ap['f_read'] || $ap['f_mod']) {
$rv['A#'.$pi['aid']] = array( $rv['A#'.$pi['aid']] = array(
"id" => $pi['aid'], "id" => $pi['aid'],
"type" => "A", "type" => "A",

View file

@ -4,7 +4,7 @@ class beta5_map_library {
var $index = array(); var $index = array();
function beta5_map_library($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -10,7 +10,7 @@ class beta5_msg_library {
'sendToPlayer' 'sendToPlayer'
); );
function beta5_msg_library($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }
@ -57,7 +57,7 @@ class beta5_msg_library {
$qs .= " AND fcustom = $cfid"; $qs .= " AND fcustom = $cfid";
} }
$q = $this->db->query($qs); $q = $this->db->query($qs);
if (!($q && count($q) == 1)) { if (!($q && pg_num_rows($q) == 1)) {
return 0; return 0;
} }
list($r) = dbFetchArray($q); list($r) = dbFetchArray($q);
@ -74,7 +74,7 @@ class beta5_msg_library {
} }
} }
$q = $this->db->query($qs); $q = $this->db->query($qs);
if (!($q && count($q) == 1)) { if (!($q && pg_num_rows($q) == 1)) {
return 0; return 0;
} }
list($r) = dbFetchArray($q); list($r) = dbFetchArray($q);

View file

@ -2,7 +2,7 @@
class beta5_planet_getIncome { class beta5_planet_getIncome {
function beta5_planet_getIncome($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules'); $this->rules = $this->lib->game->getLib('beta5/rules');

View file

@ -2,7 +2,7 @@
class beta5_planet_getStats { class beta5_planet_getStats {
function beta5_planet_getStats($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_player_get { class beta5_player_get {
function beta5_player_get($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_player_getName { class beta5_player_getName {
function beta5_player_getName($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_player_getPlanets { class beta5_player_getPlanets {
function beta5_player_getPlanets($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_player_getProtectionLevel { class beta5_player_getProtectionLevel {
function beta5_player_getProtectionLevel($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_player_isOnVacation { class beta5_player_isOnVacation {
function beta5_player_isOnVacation($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->game = $this->lib->game; $this->game = $this->lib->game;
$this->db = $this->game->getDBAccess(); $this->db = $this->game->getDBAccess();

View file

@ -2,7 +2,7 @@
class beta5_player_isRestrained { class beta5_player_isRestrained {
function beta5_player_isRestrained($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class beta5_tech_getBudget { class beta5_tech_getBudget {
function beta5_tech_getBudget($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }
@ -16,7 +16,7 @@ class beta5_tech_getBudget {
} }
list($b) = dbFetchArray($q); list($b) = dbFetchArray($q);
return split('!', $b); return explode('!', $b);
} }
} }

View file

@ -2,7 +2,7 @@
class beta5_tech_getPoints { class beta5_tech_getPoints {
function beta5_tech_getPoints($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
$this->rules = $this->lib->game->getLib('beta5/rules'); $this->rules = $this->lib->game->getLib('beta5/rules');

View file

@ -2,7 +2,7 @@
class beta5_tech_getTopics { class beta5_tech_getTopics {
function beta5_tech_getTopics($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -1,4 +1,4 @@
<? <?php
/** This action allows an user to join a game. /** This action allows an user to join a game.

View file

@ -1,4 +1,4 @@
<? <?php
/** This action allows an user to get a new password; the user first enters /** This action allows an user to get a new password; the user first enters
@ -108,7 +108,7 @@ class main_lostPassword {
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-+/*_@=#~&!"; $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-+/*_@=#~&!";
for ($i=0;$i<16;$i++) { for ($i=0;$i<16;$i++) {
do { do {
$nc = $chars{rand(0,strlen($chars)-1)}; $nc = $chars[rand(0,strlen($chars)-1)];
} while (strstr($newPass, $nc) !== false); } while (strstr($newPass, $nc) !== false);
$newPass .= $nc; $newPass .= $nc;
} }

View file

@ -23,7 +23,7 @@ class main_forums_library {
'updateLast', 'updateLast',
); );
function main_forums_library($lib) { function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class main_forums_getAdministrator { class main_forums_getAdministrator {
function main_forums_getAdministrator($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class main_forums_getCategories { class main_forums_getCategories {
function main_forums_getCategories($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class main_forums_getCategory { class main_forums_getCategory {
function main_forums_getCategory($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class main_forums_getModerator { class main_forums_getModerator {
function main_forums_getModerator($lib) { public function __construct($lib) {
$this->lib = $lib; $this->lib = $lib;
$this->db = $this->lib->game->db; $this->db = $this->lib->game->db;
} }

View file

@ -2,7 +2,7 @@
class page_layout { class page_layout {
function page_layout() { public function __construct() {
$this->dir = config::$main['scriptdir'] . "/site/beta5"; $this->dir = config::$main['scriptdir'] . "/site/beta5";
$this->static = config::$main['staticdir'] . "/beta5"; $this->static = config::$main['staticdir'] . "/beta5";
} }

View file

@ -86,7 +86,7 @@ $vac = $args['vac'];
$onVacation = ($vac['status'] == 'VAC'); $onVacation = ($vac['status'] == 'VAC');
if (count($args['play'])) { if ($args['play']) {
echo "<p>You are currently playing the following games:</p>\n"; echo "<p>You are currently playing the following games:</p>\n";
displayRegistered($args['play']); displayRegistered($args['play']);
if (isset($args['other']) && count($args['other'])) { if (isset($args['other']) && count($args['other'])) {