From 93e5869d7adad046b1a4d48cfe130dfdc606f819 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jun 2012 19:15:22 +0300 Subject: [PATCH] delete my config + fix error in automation.php when are not any users in the server and include admin in rank is disable --- GameEngine/Database/db_MYSQL.php | 2 +- GameEngine/Ranking.php | 10 +- GameEngine/config.php | 270 ------------------------------- 3 files changed, 3 insertions(+), 279 deletions(-) delete mode 100644 GameEngine/config.php diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 752c8862..f227077e 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -2631,7 +2631,7 @@ class MYSQL_DB { } function countUser() { - $q = "SELECT count(id) FROM " . TB_PREFIX . "users where id != 0"; + $q = "SELECT count(id) FROM " . TB_PREFIX . "users where id > 5"; $result = mysql_query($q, $this->connection); $row = mysql_fetch_row($result); return $row[0]; diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 193b363f..0df7c2fd 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -173,12 +173,8 @@ public function procRankArray() { global $database, $multisort; - //$array = $database->getRanking(); + if($database->countUser() > 0){ $holder = array(); - //$value['totalvillage'] = count($database->getVillagesID($value['id'])); - //$value['totalvillage'] = count($database->getVillagesID($value['id'])); - //$value['totalpop'] = $database->getVSumField($value['id'],"pop"); - //$value['aname'] = $database->getAllianceName($value['alliance']); $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) @@ -207,24 +203,22 @@ } foreach($datas as $result) { - //$value = $array[$result['userid']]; $value['userid'] = $result['userid']; $value['username'] = $result['username']; $value['alliance'] = $result['alliance']; $value['aname'] = $result['allitag']; $value['totalpop'] = $result['totalpop']; $value['totalvillage'] = $result['totalvillages']; - //SELECT (SELECT SUM(".TB_PREFIX."vdata.pop) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalpop, (SELECT COUNT(".TB_PREFIX."vdata.wref) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalvillages, (SELECT ".TB_PREFIX."alidata.tag FROM ".TB_PREFIX."alidata WHERE ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance AND ".TB_PREFIX."users.id = 2); array_push($holder, $value); } - //$holder = $multisort->sorte($holder, "'totalvillage'", false, 2, "'totalpop'", false, 2); $newholder = array("pad"); foreach($holder as $key) { array_push($newholder, $key); } $this->rankarray = $newholder; } + } private function procRankRaceArray($race) { global $database, $multisort; diff --git a/GameEngine/config.php b/GameEngine/config.php deleted file mode 100644 index f9f8a3fa..00000000 --- a/GameEngine/config.php +++ /dev/null @@ -1,270 +0,0 @@ - \ No newline at end of file