From 1ef5eff48551368cbcc55f8e8578869806c7aaf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Sep 2012 11:57:55 +0300 Subject: [PATCH] add show natars option --- GameEngine/Ranking.php | 30 +- install/data/constant_format.tpl | 3 + install/process.php | 1 + install/templates/config.tpl | 6 + install/winner.php | 1178 ------------------------------ 5 files changed, 36 insertions(+), 1182 deletions(-) delete mode 100644 install/winner.php diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 06cbd100..30a15d68 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -180,8 +180,9 @@ public function procRankArray() { global $database, $multisort; if($database->countUser() > 0){ - $holder = array(); - $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( + $holder = array(); + if(Show_Natars == True){ + $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( SELECT SUM( " . TB_PREFIX . "vdata.pop ) FROM " . TB_PREFIX . "vdata @@ -200,10 +201,31 @@ )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " - AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + }else{ + $q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, ( + SELECT SUM( " . TB_PREFIX . "vdata.pop ) + FROM " . TB_PREFIX . "vdata + WHERE " . TB_PREFIX . "vdata.owner = userid + )totalpop, ( - $result = (mysql_query($q)); + SELECT COUNT( " . TB_PREFIX . "vdata.wref ) + FROM " . TB_PREFIX . "vdata + WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99 + )totalvillages, ( + + SELECT " . TB_PREFIX . "alidata.tag + FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users + WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance + AND " . TB_PREFIX . "users.id = userid + )allitag + FROM " . TB_PREFIX . "users + WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " + AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; + } + + $result = (mysql_query($q)); while($row = mysql_fetch_assoc($result)) { $datas[] = $row; } diff --git a/install/data/constant_format.tpl b/install/data/constant_format.tpl index ffd91ea5..ca63e31c 100644 --- a/install/data/constant_format.tpl +++ b/install/data/constant_format.tpl @@ -95,6 +95,9 @@ define("PROTECTION","%BEGINNER%"); // ***** Enable WW Statistics define("WW",%WW%); +// ***** Show Natars in Statistics +define("SHOW_NATARS",%SHOW_NATARS%); + // ***** Enable T4 is Coming screen define("T4_COMING",%T4_COMING%); diff --git a/install/process.php b/install/process.php index 2fd0cb76..f74139dd 100644 --- a/install/process.php +++ b/install/process.php @@ -92,6 +92,7 @@ class Process { $text = preg_replace("'%GREAT_WKS%'", $_POST['great_wks'], $text); $text = preg_replace("'%TS_THRESHOLD%'", $_POST['ts_threshold'], $text); $text = preg_replace("'%WW%'", $_POST['ww'], $text); + $text = preg_replace("'%SHOW_NATARS%'", $_POST['show_natars'], $text); $text = preg_replace("'%T4_COMING%'", $_POST['t4_coming'], $text); $text = preg_replace("'%REG_OPEN%'", $_POST['reg_open'], $text); $text = preg_replace("'%PEACE%'", $_POST['peace'], $text); diff --git a/install/templates/config.tpl b/install/templates/config.tpl index 8fbed192..4c579f96 100644 --- a/install/templates/config.tpl +++ b/install/templates/config.tpl @@ -91,6 +91,12 @@ echo "
Error creating constant.php + Show Natars in Statistics: + + Peace system: