From 0aa0369157eded84c6f2200dead2c8bcd49a3117 Mon Sep 17 00:00:00 2001
From: unknown
Date: Wed, 4 Apr 2012 05:34:36 +0300
Subject: [PATCH] fix change village system 100%, change natars access again
and fix natars ranking
---
GameEngine/Ranking.php | 2 +-
Templates/Admin/menu.tpl | 2 +-
Templates/menu.tpl | 175 ++++++++++++++++++++++---------------
Templates/multivillage.tpl | 75 +++++++++++++++-
a2b.php | 18 +++-
allianz.php | 11 +++
berichte.php | 2 +-
create_account.php | 2 +-
dorf1.php | 8 +-
dorf2.php | 5 +-
dorf3.php | 4 +
karte.php | 9 +-
karte2.php | 8 +-
nachrichten.php | 2 +-
spieler.php | 8 +-
statistiken.php | 2 +-
winner.php | 15 ++--
17 files changed, 241 insertions(+), 107 deletions(-)
diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php
index 45cfc6a2..506509c7 100644
--- a/GameEngine/Ranking.php
+++ b/GameEngine/Ranking.php
@@ -46,7 +46,7 @@
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop
FROM " . TB_PREFIX . "users
- WHERE " . TB_PREFIX . "users.id != 0 and id != 1 and id != 2 and id != 3 and id != 4 and id != 5
+ WHERE " . TB_PREFIX . "users.id != 0 and id != 1 and id != 2 and id != 4 and id != 5
ORDER BY totalpop DESC, userid ASC";
$result = mysql_query($q);
$i = 1;
diff --git a/Templates/Admin/menu.tpl b/Templates/Admin/menu.tpl
index 5ba51a76..92f7c9f0 100644
--- a/Templates/Admin/menu.tpl
+++ b/Templates/Admin/menu.tpl
@@ -41,7 +41,7 @@ include_once ("GameEngine/Ranking.php");
Server config
Mass message
System message
- Update top 10
+ Update top 10
Add World Wonder Villages
diff --git a/Templates/menu.tpl b/Templates/menu.tpl
index 92f7c9f0..f7efeacd 100644
--- a/Templates/menu.tpl
+++ b/Templates/menu.tpl
@@ -1,75 +1,106 @@
logged_in) {
?>
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+
Announcement
+
+
Hi username; ?>,
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Calculated in pageLoadTimeEnd()-$start)*1000);
+ ?> ms
+
+ Server time:
+
+
+
+
+
+
+
diff --git a/Templates/multivillage.tpl b/Templates/multivillage.tpl
index e358ec8f..87493665 100644
--- a/Templates/multivillage.tpl
+++ b/Templates/multivillage.tpl
@@ -14,12 +14,85 @@ if(count($session->villages) > 1){?>
| : |
getArrayMemberVillage($session->uid);
+if(isset($_GET['w'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['r'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['o'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['z'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['s'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['c'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['t'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['d'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else if(isset($_GET['aid'])) {
+ for($i=1;$i<=count($session->villages);++$i){echo'
+
+ | ● |
+ '.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
+ ('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
+ }
+}
+else{
for($i=1;$i<=count($session->villages);++$i){echo'
| ● |
'.htmlspecialchars($returnVillageArray[$i-1]['name']).' |
('.$returnVillageArray[$i-1]['x'].' | '.$returnVillageArray[$i-1]['y'].') |
';
- }?>
+ }}?>
pageLoadTimeStart();
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
+if(isset($_GET['w'])) {
+ header("Location: ".$_SERVER['PHP_SELF']."?w=".$_GET['w']);
+}
+else if(isset($_GET['r'])) {
+ header("Location: ".$_SERVER['PHP_SELF']."?r=".$_GET['r']);
+}
+else if(isset($_GET['o'])) {
+ header("Location: ".$_SERVER['PHP_SELF']."?o=".$_GET['o']);
+}
+else if(isset($_GET['z'])) {
+ header("Location: ".$_SERVER['PHP_SELF']."?z=".$_GET['z']);
+}
+else if($_GET['id']!=0){
header("Location: ".$_SERVER['PHP_SELF']);
}
+}
else {
$building->procBuild($_GET);
}
@@ -41,11 +55,7 @@ if(isset($_GET['o'])) {
$checked ="checked=checked";
}
$process = $units->procUnits($_POST);
-
-if(isset($_GET['z']))
-{
$automation->isWinner();
-}
?>
diff --git a/allianz.php b/allianz.php
index 20bbcc5a..de7ea319 100644
--- a/allianz.php
+++ b/allianz.php
@@ -19,6 +19,17 @@
include ("GameEngine/Chat.php");
$start = $generator->pageLoadTimeStart();
$alliance->procAlliance($_GET);
+if(isset($_GET['newdid'])) {
+ $_SESSION['wid'] = $_GET['newdid'];
+ if(isset($_GET['s'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']);
+ }else if(isset($_GET['aid'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?aid=".$_GET['aid']);
+ }
+ else{
+ header("Location: ".$_SERVER['PHP_SELF']);
+}
+}
if(isset($_GET['s'])){
$automation->isWinner();
}
diff --git a/berichte.php b/berichte.php
index f95eedc7..2e45053f 100644
--- a/berichte.php
+++ b/berichte.php
@@ -18,7 +18,7 @@ if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
if(isset($_GET['t'])) {
header("Location: ".$_SERVER['PHP_SELF']."?t=".$_GET['t']);
-}else if(isset($_GET['id'])) {
+}else if($_GET['id']!=0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$_GET['id']);
}else{
header("Location: ".$_SERVER['PHP_SELF']);
diff --git a/create_account.php b/create_account.php
index 2d2ad9d8..974d4166 100644
--- a/create_account.php
+++ b/create_account.php
@@ -63,7 +63,7 @@
$wid = mysql_fetch_assoc(mysql_query("SELECT * FROM " . TB_PREFIX . "vdata WHERE owner = $uid"));
$q = "UPDATE " . TB_PREFIX . "vdata SET pop = 834 WHERE owner = $uid";
mysql_query($q) or die(mysql_error());
- $q2 = "UPDATE " . TB_PREFIX . "users SET access = 8 WHERE id = $uid";
+ $q2 = "UPDATE " . TB_PREFIX . "users SET access = 2 WHERE id = $uid";
mysql_query($q2) or die(mysql_error());
if(SPEED > 3) {
$speed = 5;
diff --git a/dorf1.php b/dorf1.php
index 85b7d473..1bdead59 100644
--- a/dorf1.php
+++ b/dorf1.php
@@ -12,13 +12,13 @@
include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
if(isset($_GET['ok'])){
- $database->updateUserField($session->username,'ok','0','0'); $_SESSION['ok'] = '0'; }
+$database->updateUserField($session->username,'ok','0','0'); $_SESSION['ok'] = '0';
+}
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
header("Location: ".$_SERVER['PHP_SELF']);
-}
-else {
- $building->procBuild($_GET);
+}else{
+$building->procBuild($_GET);
}
?>
diff --git a/dorf2.php b/dorf2.php
index 6132e91b..6da4bdbd 100644
--- a/dorf2.php
+++ b/dorf2.php
@@ -14,9 +14,8 @@ $start = $generator->pageLoadTimeStart();
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
header("Location: ".$_SERVER['PHP_SELF']);
-}
-else {
- $building->procBuild($_GET);
+}else{
+$building->procBuild($_GET);
}
?>
diff --git a/dorf3.php b/dorf3.php
index 25d50a10..b16e0eb4 100644
--- a/dorf3.php
+++ b/dorf3.php
@@ -15,8 +15,12 @@ include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
+ if(isset($_GET['s'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']);
+ }else{
header("Location: ".$_SERVER['PHP_SELF']);
}
+}
?>
diff --git a/karte.php b/karte.php
index 2d47fa89..a0adc958 100644
--- a/karte.php
+++ b/karte.php
@@ -15,9 +15,16 @@ include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
+ if(isset($_GET['d'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?d=".$_GET['d']);
+}
+else if(isset($_GET['c'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?c=".$_GET['c']);
+}
+else{
header("Location: ".$_SERVER['PHP_SELF']);
}
-else {
+} else {
$building->procBuild($_GET);
}
?>
diff --git a/karte2.php b/karte2.php
index 3797090c..0fac757e 100644
--- a/karte2.php
+++ b/karte2.php
@@ -10,13 +10,7 @@
#################################################################################
include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
-if(isset($_GET['newdid'])) {
- $_SESSION['wid'] = $_GET['newdid'];
- header("Location: ".$_SERVER['PHP_SELF']);
-}
-else {
- $building->procBuild($_GET);
-}
+ $building->procBuild($_GET);
if($session->plus){
?>
diff --git a/nachrichten.php b/nachrichten.php
index 5cb5558c..48f5227e 100644
--- a/nachrichten.php
+++ b/nachrichten.php
@@ -21,7 +21,7 @@ if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
if(isset($_GET['t'])) {
header("Location: ".$_SERVER['PHP_SELF']."?t=".$_GET['t']);
-}else if(isset($_GET['id'])) {
+}else if($_GET['id']!=0) {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$_GET['id']);
}else{
header("Location: ".$_SERVER['PHP_SELF']);
diff --git a/spieler.php b/spieler.php
index 80f5cf4a..b536e4e7 100644
--- a/spieler.php
+++ b/spieler.php
@@ -10,15 +10,21 @@
## ##
#################################################################################
-ob_start();
include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
$profile->procProfile($_POST);
$profile->procSpecial($_GET);
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
+ if(isset($_GET['s'])){
+ header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']);
+ }else{
header("Location: ".$_SERVER['PHP_SELF']);
}
+}
+else {
+ $building->procBuild($_GET);
+}
if(isset($_GET['s'])){
$automation->isWinner();
}
diff --git a/statistiken.php b/statistiken.php
index 57d087e3..49b63cdc 100644
--- a/statistiken.php
+++ b/statistiken.php
@@ -18,7 +18,7 @@ $ranking->procRankReq($_GET);
$ranking->procRank($_POST);
if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
- header("Location: ".$_SERVER['PHP_SELF']);
+ header("Location: ".$_SERVER['PHP_SELF']."?id=".$_GET['id']);
}
?>
diff --git a/winner.php b/winner.php
index 696b9228..7631ae26 100644
--- a/winner.php
+++ b/winner.php
@@ -9,14 +9,13 @@
##################################################################
include("GameEngine/Village.php");
$start = $generator->pageLoadTimeStart();
-if(isset($_GET['newdid']))
-{
- $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']);
-}
-else
-{
- $building->procBuild($_GET);
-}
+if(isset($_GET['newdid'])) {
+ $_SESSION['wid'] = $_GET['newdid'];
+ header("Location: ".$_SERVER['PHP_SELF']);
+}
+else {
+ $building->procBuild($_GET);
+}
## Get Rankings for Ranking Section
## Top 3 Population