diff --git a/scripts/game/beta5/actions/getCommsOverview.inc b/scripts/game/beta5/actions/getCommsOverview.inc index 36e3739..cce1f56 100644 --- a/scripts/game/beta5/actions/getCommsOverview.inc +++ b/scripts/game/beta5/actions/getCommsOverview.inc @@ -1,4 +1,4 @@ -lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/fleet/library/getUpkeep.inc b/scripts/game/beta5/fleet/library/getUpkeep.inc index 4a78c18..0a1bd51 100644 --- a/scripts/game/beta5/fleet/library/getUpkeep.inc +++ b/scripts/game/beta5/fleet/library/getUpkeep.inc @@ -2,7 +2,7 @@ class beta5_fleet_getUpkeep { - function beta5_fleet_getUpkeep($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->rules = $this->lib->game->getLib('beta5/rules'); diff --git a/scripts/game/beta5/forums/library/getStructure.inc b/scripts/game/beta5/forums/library/getStructure.inc index 63a4eb1..4d954fe 100644 --- a/scripts/game/beta5/forums/library/getStructure.inc +++ b/scripts/game/beta5/forums/library/getStructure.inc @@ -2,7 +2,7 @@ class beta5_forums_getStructure { - function beta5_forums_getStructure($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->players = $this->lib->game->getLib('beta5/player'); @@ -69,7 +69,7 @@ class beta5_forums_getStructure { // Get alliance forums $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( "id" => $pi['aid'], "type" => "A", diff --git a/scripts/game/beta5/map/library.inc b/scripts/game/beta5/map/library.inc index 28a7857..7974641 100644 --- a/scripts/game/beta5/map/library.inc +++ b/scripts/game/beta5/map/library.inc @@ -4,7 +4,7 @@ class beta5_map_library { var $index = array(); - function beta5_map_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/msg/library.inc b/scripts/game/beta5/msg/library.inc index 420d7d4..d878365 100644 --- a/scripts/game/beta5/msg/library.inc +++ b/scripts/game/beta5/msg/library.inc @@ -10,7 +10,7 @@ class beta5_msg_library { 'sendToPlayer' ); - function beta5_msg_library($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } @@ -57,7 +57,7 @@ class beta5_msg_library { $qs .= " AND fcustom = $cfid"; } $q = $this->db->query($qs); - if (!($q && count($q) == 1)) { + if (!($q && pg_num_rows($q) == 1)) { return 0; } list($r) = dbFetchArray($q); @@ -74,7 +74,7 @@ class beta5_msg_library { } } $q = $this->db->query($qs); - if (!($q && count($q) == 1)) { + if (!($q && pg_num_rows($q) == 1)) { return 0; } list($r) = dbFetchArray($q); diff --git a/scripts/game/beta5/planet/library/getIncome.inc b/scripts/game/beta5/planet/library/getIncome.inc index cfbf5fc..9573f62 100644 --- a/scripts/game/beta5/planet/library/getIncome.inc +++ b/scripts/game/beta5/planet/library/getIncome.inc @@ -2,7 +2,7 @@ class beta5_planet_getIncome { - function beta5_planet_getIncome($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->rules = $this->lib->game->getLib('beta5/rules'); diff --git a/scripts/game/beta5/planet/library/getStats.inc b/scripts/game/beta5/planet/library/getStats.inc index 10c8a1a..1bdc487 100644 --- a/scripts/game/beta5/planet/library/getStats.inc +++ b/scripts/game/beta5/planet/library/getStats.inc @@ -2,7 +2,7 @@ class beta5_planet_getStats { - function beta5_planet_getStats($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/get.inc b/scripts/game/beta5/player/library/get.inc index 6ba4dd3..58643cf 100644 --- a/scripts/game/beta5/player/library/get.inc +++ b/scripts/game/beta5/player/library/get.inc @@ -2,7 +2,7 @@ class beta5_player_get { - function beta5_player_get($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/getName.inc b/scripts/game/beta5/player/library/getName.inc index fd8f791..5cd8b4d 100644 --- a/scripts/game/beta5/player/library/getName.inc +++ b/scripts/game/beta5/player/library/getName.inc @@ -2,7 +2,7 @@ class beta5_player_getName { - function beta5_player_getName($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/getPlanets.inc b/scripts/game/beta5/player/library/getPlanets.inc index e5f75e4..e83c8d1 100644 --- a/scripts/game/beta5/player/library/getPlanets.inc +++ b/scripts/game/beta5/player/library/getPlanets.inc @@ -2,7 +2,7 @@ class beta5_player_getPlanets { - function beta5_player_getPlanets($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/getProtectionLevel.inc b/scripts/game/beta5/player/library/getProtectionLevel.inc index e538773..029e23d 100644 --- a/scripts/game/beta5/player/library/getProtectionLevel.inc +++ b/scripts/game/beta5/player/library/getProtectionLevel.inc @@ -2,7 +2,7 @@ class beta5_player_getProtectionLevel { - function beta5_player_getProtectionLevel($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/player/library/isOnVacation.inc b/scripts/game/beta5/player/library/isOnVacation.inc index 79b542d..bbbcbb3 100644 --- a/scripts/game/beta5/player/library/isOnVacation.inc +++ b/scripts/game/beta5/player/library/isOnVacation.inc @@ -2,7 +2,7 @@ class beta5_player_isOnVacation { - function beta5_player_isOnVacation($lib) { + public function __construct($lib) { $this->lib = $lib; $this->game = $this->lib->game; $this->db = $this->game->getDBAccess(); diff --git a/scripts/game/beta5/player/library/isRestrained.inc b/scripts/game/beta5/player/library/isRestrained.inc index d6ec24f..7ca7c1f 100644 --- a/scripts/game/beta5/player/library/isRestrained.inc +++ b/scripts/game/beta5/player/library/isRestrained.inc @@ -2,7 +2,7 @@ class beta5_player_isRestrained { - function beta5_player_isRestrained($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/beta5/tech/library/getBudget.inc b/scripts/game/beta5/tech/library/getBudget.inc index a44ed20..2e0aaa8 100644 --- a/scripts/game/beta5/tech/library/getBudget.inc +++ b/scripts/game/beta5/tech/library/getBudget.inc @@ -2,7 +2,7 @@ class beta5_tech_getBudget { - function beta5_tech_getBudget($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } @@ -16,7 +16,7 @@ class beta5_tech_getBudget { } list($b) = dbFetchArray($q); - return split('!', $b); + return explode('!', $b); } } diff --git a/scripts/game/beta5/tech/library/getPoints.inc b/scripts/game/beta5/tech/library/getPoints.inc index c3056ae..ef772b0 100644 --- a/scripts/game/beta5/tech/library/getPoints.inc +++ b/scripts/game/beta5/tech/library/getPoints.inc @@ -2,7 +2,7 @@ class beta5_tech_getPoints { - function beta5_tech_getPoints($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; $this->rules = $this->lib->game->getLib('beta5/rules'); diff --git a/scripts/game/beta5/tech/library/getTopics.inc b/scripts/game/beta5/tech/library/getTopics.inc index 567b2ab..0d06831 100644 --- a/scripts/game/beta5/tech/library/getTopics.inc +++ b/scripts/game/beta5/tech/library/getTopics.inc @@ -2,7 +2,7 @@ class beta5_tech_getTopics { - function beta5_tech_getTopics($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/actions/joinGame.inc b/scripts/game/main/actions/joinGame.inc index e1d02aa..e180035 100644 --- a/scripts/game/main/actions/joinGame.inc +++ b/scripts/game/main/actions/joinGame.inc @@ -1,4 +1,4 @@ -lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/forums/library/getAdministrator.inc b/scripts/game/main/forums/library/getAdministrator.inc index 7821876..77d355e 100644 --- a/scripts/game/main/forums/library/getAdministrator.inc +++ b/scripts/game/main/forums/library/getAdministrator.inc @@ -2,7 +2,7 @@ class main_forums_getAdministrator { - function main_forums_getAdministrator($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/forums/library/getCategories.inc b/scripts/game/main/forums/library/getCategories.inc index 127ce6f..bb5b6d4 100644 --- a/scripts/game/main/forums/library/getCategories.inc +++ b/scripts/game/main/forums/library/getCategories.inc @@ -2,7 +2,7 @@ class main_forums_getCategories { - function main_forums_getCategories($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/forums/library/getCategory.inc b/scripts/game/main/forums/library/getCategory.inc index b7962ac..24f7181 100644 --- a/scripts/game/main/forums/library/getCategory.inc +++ b/scripts/game/main/forums/library/getCategory.inc @@ -2,7 +2,7 @@ class main_forums_getCategory { - function main_forums_getCategory($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/game/main/forums/library/getModerator.inc b/scripts/game/main/forums/library/getModerator.inc index 2ed1b13..3853875 100644 --- a/scripts/game/main/forums/library/getModerator.inc +++ b/scripts/game/main/forums/library/getModerator.inc @@ -2,7 +2,7 @@ class main_forums_getModerator { - function main_forums_getModerator($lib) { + public function __construct($lib) { $this->lib = $lib; $this->db = $this->lib->game->db; } diff --git a/scripts/site/beta5/page.inc b/scripts/site/beta5/page.inc index 7148cc2..f0afd4b 100644 --- a/scripts/site/beta5/page.inc +++ b/scripts/site/beta5/page.inc @@ -2,7 +2,7 @@ class page_layout { - function page_layout() { + public function __construct() { $this->dir = config::$main['scriptdir'] . "/site/beta5"; $this->static = config::$main['staticdir'] . "/beta5"; } diff --git a/scripts/site/main/output/account.en.inc b/scripts/site/main/output/account.en.inc index 7d58259..ee6862f 100644 --- a/scripts/site/main/output/account.en.inc +++ b/scripts/site/main/output/account.en.inc @@ -86,7 +86,7 @@ $vac = $args['vac']; $onVacation = ($vac['status'] == 'VAC'); -if (count($args['play'])) { +if ($args['play']) { echo "

You are currently playing the following games:

\n"; displayRegistered($args['play']); if (isset($args['other']) && count($args['other'])) {