From 92b360b83ada15090ed96ba70c84fc26a7f47737 Mon Sep 17 00:00:00 2001 From: Shadow Date: Mon, 3 Mar 2014 10:16:33 +0200 Subject: [PATCH 1/8] Update newsbox1.tpl --- Templates/News/newsbox1.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Templates/News/newsbox1.tpl b/Templates/News/newsbox1.tpl index fbccac4f..e4da5822 100644 --- a/Templates/News/newsbox1.tpl +++ b/Templates/News/newsbox1.tpl @@ -1,4 +1,4 @@ -
newsbox 2
+
newsbox 1
Date: Tue, 4 Mar 2014 08:22:01 +0200 Subject: [PATCH 2/8] Update sql.sql --- install/data/sql.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/install/data/sql.sql b/install/data/sql.sql index d6843aeb..aff65057 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1500,6 +1500,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` ( `friend18wait` int(11) unsigned NOT NULL, `friend19wait` int(11) unsigned NOT NULL, `maxevasion` mediumint(3) unsigned NOT NULL, + `village_select` bigint(20) yes NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ; From 66b15135fe29ffd84f35cc5e656429a4fa98810c Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 08:22:58 +0200 Subject: [PATCH 3/8] Update Session.php --- GameEngine/Session.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/GameEngine/Session.php b/GameEngine/Session.php index 2f0da65b..eecb98d5 100644 --- a/GameEngine/Session.php +++ b/GameEngine/Session.php @@ -84,16 +84,27 @@ class Session { $_SESSION['checker'] = $generator->generateRandStr(3); $_SESSION['mchecker'] = $generator->generateRandStr(5); $_SESSION['qst'] = $database->getUserField($_SESSION['username'], "quest", 1); - if(!isset($_SESSION['wid'])) { - $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1'); - $data = mysql_fetch_assoc($query); - $_SESSION['wid'] = $data['wref']; - } else - if($_SESSION['wid'] == '') { - $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1'); - $data = mysql_fetch_assoc($query); - $_SESSION['wid'] = $data['wref']; - } + $result = mysql_query("SELECT village_select FROM `". TB_PREFIX."users` WHERE `username`='".$_SESSION['username']."'"); + $dbarray = mysql_fetch_assoc($result); + $selected_village=$dbarray['village_select']; + if(!isset($_SESSION['wid'])) { + if($selected_village!='') { + $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village); + }else{ + $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1'); + } + $data = mysql_fetch_assoc($query); + $_SESSION['wid'] = $data['wref']; + } else + if($_SESSION['wid'] == '') { + if($selected_village!='') { + $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = '.$selected_village); + }else{ + $query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1'); + } + $data = mysql_fetch_assoc($query); + $_SESSION['wid'] = $data['wref']; + } $this->PopulateVar(); $logging->addLoginLog($this->uid, $_SERVER['REMOTE_ADDR']); From 68c267ff1c0f15e182d68ecf38e85c0959019d06 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 08:23:44 +0200 Subject: [PATCH 4/8] Update dorf3.php --- dorf3.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dorf3.php b/dorf3.php index cc1e579c..178db277 100644 --- a/dorf3.php +++ b/dorf3.php @@ -14,7 +14,8 @@ include("GameEngine/Village.php"); $start = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { - $_SESSION['wid'] = $_GET['newdid']; + $_SESSION['wid'] = $_GET['newdid']; + $database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid); if(isset($_GET['s'])){ header("Location: ".$_SERVER['PHP_SELF']."?s=".$_GET['s']); }else{ From e66249967558891f526ce2cfe5e97ea378c9fe57 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 08:23:47 +0200 Subject: [PATCH 5/8] Update dorf2.php --- dorf2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dorf2.php b/dorf2.php index e54ff3f9..22187304 100644 --- a/dorf2.php +++ b/dorf2.php @@ -12,7 +12,8 @@ include("GameEngine/Village.php"); $start = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { - $_SESSION['wid'] = $_GET['newdid']; + $_SESSION['wid'] = $_GET['newdid']; + $database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid); header("Location: ".$_SERVER['PHP_SELF']); }else{ $building->procBuild($_GET); From ecbb939898b7f6327ede40a527ce134cb86a1313 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 08:23:49 +0200 Subject: [PATCH 6/8] Update dorf1.php --- dorf1.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dorf1.php b/dorf1.php index 76821715..c6d1bb63 100644 --- a/dorf1.php +++ b/dorf1.php @@ -15,7 +15,8 @@ if(isset($_GET['ok'])){ $database->updateUserField($session->uid,'ok','0','1'); $_SESSION['ok'] = '0'; } if(isset($_GET['newdid'])) { - $_SESSION['wid'] = $_GET['newdid']; + $_SESSION['wid'] = $_GET['newdid']; + $database->query("UPDATE ".TB_PREFIX."users SET village_select=".$_GET['newdid']." WHERE id=".$session->uid); header("Location: ".$_SERVER['PHP_SELF']); }else{ $building->procBuild($_GET); From 5a9570c65ffe0f243b07665578561143b342e6a7 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 08:56:42 +0200 Subject: [PATCH 7/8] Update village.tpl --- Admin/Templates/village.tpl | 183 ++++++++++-------------------------- 1 file changed, 49 insertions(+), 134 deletions(-) diff --git a/Admin/Templates/village.tpl b/Admin/Templates/village.tpl index 8646b4ee..bfb977a1 100644 --- a/Admin/Templates/village.tpl +++ b/Admin/Templates/village.tpl @@ -6,10 +6,11 @@ ## Developed by: Dzoki & Advocatie ## ## License: TravianX Project ## ## Thanks to: Dzoki & itay2277(Edit some additions) ## -## Copyright: TravianX (c) 2010-2011. All rights reserved. ## +## Fix by: ronix (some additions) ## +## Copyright: TravianZ (c) 2010-2014. All rights reserved. ## ## Improved: aggenkeech ## ################################################################################# -error_reporting(0); +if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!"); $id = $_GET['did']; if(isset($id)) { @@ -20,6 +21,7 @@ if(isset($id)) $type = $database->getVillageType($village['wref']); $fdata = $database->getResourceLevel($village['wref']); $units = $database->getUnit($village['wref']); + $abtech = $database->getABTech($id); // Armory/blacksmith level if($type == 1){ $typ = array(3,3,3,9); } elseif($type == 2){ $typ = array(3,4,5,6); } elseif($type == 3){ $typ = array(4,4,4,6); } @@ -32,14 +34,31 @@ if(isset($id)) elseif($type == 10){ $typ = array(3,5,4,6); } elseif($type == 11){ $typ = array(4,5,3,6); } elseif($type == 12){ $typ = array(5,4,3,6); } - $refreshicon = ""; + $ocounter = array(); + $wood = $clay = $iron =$crop = 0; + $q = "SELECT o.*, w.x, w.y FROM ".TB_PREFIX."odata AS o LEFT JOIN ".TB_PREFIX."wdata AS w ON o.wref=w.id WHERE conqured = ".$village['wref']; + $result = $database->query_return($q); + if(count($result) >0) + { + foreach($result as $row) + { + $type = $row['type']; + if($type==1) { $type = ' + 25%'; $wood+=1;} + elseif($type==2) { $type = ' + 25%'; $wood+=1;} + elseif($type==3) { $type = ' + 25%
+ 25%'; $wood+=1; $crop+=1;} + elseif($type==4) { $type = ' + 25%'; $clay+=1;} + elseif($type==5) { $type = ' + 25%'; $clay+=1;} + elseif($type==6) { $type = ' + 25%
+ 25%'; $clay+=1;$crop+=1;} + elseif($type==7) { $type = ' + 25%'; $iron+=1;} + elseif($type==8) { $type = ' + 25%'; $iron+=1;} + elseif($type==9) { $type = ' + 25%
+ 25%'; $iron+=1; $crop+=1;} + elseif($type==10){ $type = ' + 25%'; $crop+=1;} + elseif($type==11){ $type = ' + 25%'; $crop+=1;} + elseif($type==12){ $type = ' + 50%'; $crop+=2;} + } + } + $ocounter = array($wood,$clay,$iron,$crop); + $production=$admin->calculateProduction($id,$user['id'],$user['b1'],$user['b2'],$user['b3'],$user['b4'],$fdata, $ocounter, $village['pop']); $refreshiconfrm = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAIAAADpZ+PpAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEQSURBVChTY/gPBkevHfRrtjMsU9bJ05+5eylE @@ -48,6 +67,8 @@ if(isset($id)) 91l+gRNDLzw6f+nepcsPrl14cPXW8wcMWqVaEYdtPdZYubUHww0AMs5cusygU68UtVUr87CPWbdd 9Ly83TcO7Lq2I7ozoXfZTAalCjWZemnlaYo2u0wVFkoJdwoyZDOZNDi//vqRwbkjac+dC827p2h3 Gyh3S6m0a0Qszrnz6RnQWAAxV5tT/VAiNQAAAABJRU5ErkJggg=="; + $refreshicon = ""; + class Generator { public function getMapCheck($wref) @@ -56,6 +77,7 @@ if(isset($id)) } }; $generator = new Generator; + if($village and $user) { include("search2.tpl"); ?> @@ -98,7 +120,7 @@ if(isset($id)) Coordinates: - (|) + () Village ID @@ -129,22 +151,12 @@ if(isset($id)) - + - - - - - + - @@ -152,28 +164,24 @@ if(isset($id)) - - + - - + - - + - - +
ResourcesResources
Resource
Warehouse Warehouse Production
Lumber
???
Clay
???
Iron
???
Crop
???
@@ -225,7 +233,7 @@ if(isset($id)) - + @@ -237,72 +245,21 @@ if(isset($id)) getOasis($id); - $oases = count($oasisarray); - for($o=0; $o<$oases; $o++) + if(count($result) >0) { - $oasiscoor = $database->getCoor($oasisarray['$o']['wref']); - $type = $oasisarray['type']; - if($type==1) { $type = ' + 25%'; } - elseif($type==2) { $type = ' + 25%'; } - elseif($type==3) { $type = ' + 25%
+ 25%'; } - elseif($type==4) { $type = ' + 25%'; } - elseif($type==5) { $type = ' + 25%'; } - elseif($type==6) { $type = ' + 25%
+ 25%'; } - elseif($type==7) { $type = ' + 25%'; } - elseif($type==8) { $type = ' + 25%'; } - elseif($type==9) { $type = ' + 25%
+ 25%'; } - elseif($type==10){ $type = ' + 25%'; } - elseif($type==11){ $type = ' + 25%'; } - elseif($type==12){ $type = ' + 50%'; } - echo ' - - - - - - - '; - } */ - ?> - getOasis($village['wref']); - $isthere = count($oasisarray); - if($isthere >0) - { - $query = "SELECT * FROM ".TB_PREFIX."odata WHERE conqured = ".$village['wref'].""; - $result = mysql_query($query); - while($row = mysql_fetch_assoc($result)) + foreach($result as $row) { - $oasiswref = $row['wref']; - $oasisx = mysql_result(mysql_query("SELECT x FROM ".TB_PREFIX."wdata WHERE id = ".$oasiswref.""), 0); - $oasisy = mysql_result(mysql_query("SELECT y FROM ".TB_PREFIX."wdata WHERE id = ".$oasiswref.""), 0); - - $type = $row['type']; - if($type==1) { $type = ' + 25%'; } - elseif($type==2) { $type = ' + 25%'; } - elseif($type==3) { $type = ' + 25%
+ 25%'; } - elseif($type==4) { $type = ' + 25%'; } - elseif($type==5) { $type = ' + 25%'; } - elseif($type==6) { $type = ' + 25%
+ 25%'; } - elseif($type==7) { $type = ' + 25%'; } - elseif($type==8) { $type = ' + 25%'; } - elseif($type==9) { $type = ' + 25%
+ 25%'; } - elseif($type==10){ $type = ' + 25%'; } - elseif($type==11){ $type = ' + 25%'; } - elseif($type==12){ $type = ' + 50%'; } echo " - + - + "; - } ## + } } - elseif($isthere ==0) + elseif($result ==0) { echo ''; } @@ -315,7 +272,7 @@ if(isset($id)) ?> @@ -332,7 +289,7 @@ if(isset($id)) ?>
- -
+

@@ -408,48 +365,6 @@ if(isset($id))
- - - - - - - - - - -
OasesOasis
'.$oasisarray['name'].'('.$oasiscoor['x'].'|'.$oasiscoor['y'].')'.$oasisarray['loyalty'].''.$type.'
".$row['name']."getMapCheck($row['wref'])."\" target=\"blank\">(".$oasisx."|".$oasisy.")getMapCheck($row['wref'])."\" target=\"blank\">(".$row['x']."|".$row['y'].") ".$row['loyalty']."% $type
".$row['wood']."
".$row['clay']."
".$row['iron']."
".$row['crop']."
This village has no oases
From f343a4a791674f8f8eb4866de9e9a9fe67b15824 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 4 Mar 2014 09:00:14 +0200 Subject: [PATCH 8/8] Update village.tpl --- Admin/Templates/village.tpl | 183 ++++++++++++++++++++++++++---------- 1 file changed, 134 insertions(+), 49 deletions(-) diff --git a/Admin/Templates/village.tpl b/Admin/Templates/village.tpl index bfb977a1..0fb467e3 100644 --- a/Admin/Templates/village.tpl +++ b/Admin/Templates/village.tpl @@ -6,11 +6,10 @@ ## Developed by: Dzoki & Advocatie ## ## License: TravianX Project ## ## Thanks to: Dzoki & itay2277(Edit some additions) ## -## Fix by: ronix (some additions) ## -## Copyright: TravianZ (c) 2010-2014. All rights reserved. ## +## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## Improved: aggenkeech ## ################################################################################# -if($_SESSION['access'] < 9) die("Access Denied: You are not Admin!"); +error_reporting(0); $id = $_GET['did']; if(isset($id)) { @@ -21,7 +20,6 @@ if(isset($id)) $type = $database->getVillageType($village['wref']); $fdata = $database->getResourceLevel($village['wref']); $units = $database->getUnit($village['wref']); - $abtech = $database->getABTech($id); // Armory/blacksmith level if($type == 1){ $typ = array(3,3,3,9); } elseif($type == 2){ $typ = array(3,4,5,6); } elseif($type == 3){ $typ = array(4,4,4,6); } @@ -34,31 +32,14 @@ if(isset($id)) elseif($type == 10){ $typ = array(3,5,4,6); } elseif($type == 11){ $typ = array(4,5,3,6); } elseif($type == 12){ $typ = array(5,4,3,6); } - $ocounter = array(); - $wood = $clay = $iron =$crop = 0; - $q = "SELECT o.*, w.x, w.y FROM ".TB_PREFIX."odata AS o LEFT JOIN ".TB_PREFIX."wdata AS w ON o.wref=w.id WHERE conqured = ".$village['wref']; - $result = $database->query_return($q); - if(count($result) >0) - { - foreach($result as $row) - { - $type = $row['type']; - if($type==1) { $type = ' + 25%'; $wood+=1;} - elseif($type==2) { $type = ' + 25%'; $wood+=1;} - elseif($type==3) { $type = ' + 25%
+ 25%'; $wood+=1; $crop+=1;} - elseif($type==4) { $type = ' + 25%'; $clay+=1;} - elseif($type==5) { $type = ' + 25%'; $clay+=1;} - elseif($type==6) { $type = ' + 25%
+ 25%'; $clay+=1;$crop+=1;} - elseif($type==7) { $type = ' + 25%'; $iron+=1;} - elseif($type==8) { $type = ' + 25%'; $iron+=1;} - elseif($type==9) { $type = ' + 25%
+ 25%'; $iron+=1; $crop+=1;} - elseif($type==10){ $type = ' + 25%'; $crop+=1;} - elseif($type==11){ $type = ' + 25%'; $crop+=1;} - elseif($type==12){ $type = ' + 50%'; $crop+=2;} - } - } - $ocounter = array($wood,$clay,$iron,$crop); - $production=$admin->calculateProduction($id,$user['id'],$user['b1'],$user['b2'],$user['b3'],$user['b4'],$fdata, $ocounter, $village['pop']); + $refreshicon = ""; $refreshiconfrm = "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAkAAAAKCAIAAADpZ+PpAAAAAXNSR0IArs4c6QAAAARnQU1BAACx jwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEQSURBVChTY/gPBkevHfRrtjMsU9bJ05+5eylE @@ -67,8 +48,6 @@ if(isset($id)) 91l+gRNDLzw6f+nepcsPrl14cPXW8wcMWqVaEYdtPdZYubUHww0AMs5cusygU68UtVUr87CPWbdd 9Ly83TcO7Lq2I7ozoXfZTAalCjWZemnlaYo2u0wVFkoJdwoyZDOZNDi//vqRwbkjac+dC827p2h3 Gyh3S6m0a0Qszrnz6RnQWAAxV5tT/VAiNQAAAABJRU5ErkJggg=="; - $refreshicon = ""; - class Generator { public function getMapCheck($wref) @@ -77,7 +56,6 @@ if(isset($id)) } }; $generator = new Generator; - if($village and $user) { include("search2.tpl"); ?> @@ -120,7 +98,7 @@ if(isset($id))
- + @@ -151,12 +129,22 @@ if(isset($id))
Coordinates:()(|)
Village ID
- + - + + + + + + @@ -164,24 +152,28 @@ if(isset($id)) - + + - + + - + + - + +
Resources Resources
ResourceWarehouse
Warehouse Production
Lumber
getProd("wood"); ?>
Clay
getProd("clay"); ?>
Iron
getProd("iron"); ?>
Crop
getProd("crop"); ?>
@@ -233,7 +225,7 @@ if(isset($id)) - + @@ -245,21 +237,72 @@ if(isset($id)) 0) + /* + $oasisarray = $database->getOasis($id); + $oases = count($oasisarray); + for($o=0; $o<$oases; $o++) { - foreach($result as $row) + $oasiscoor = $database->getCoor($oasisarray['$o']['wref']); + $type = $oasisarray['type']; + if($type==1) { $type = ' + 25%'; } + elseif($type==2) { $type = ' + 25%'; } + elseif($type==3) { $type = ' + 25%
+ 25%'; } + elseif($type==4) { $type = ' + 25%'; } + elseif($type==5) { $type = ' + 25%'; } + elseif($type==6) { $type = ' + 25%
+ 25%'; } + elseif($type==7) { $type = ' + 25%'; } + elseif($type==8) { $type = ' + 25%'; } + elseif($type==9) { $type = ' + 25%
+ 25%'; } + elseif($type==10){ $type = ' + 25%'; } + elseif($type==11){ $type = ' + 25%'; } + elseif($type==12){ $type = ' + 50%'; } + echo ' + + + + + + + '; + } */ + ?> + getOasis($village['wref']); + $isthere = count($oasisarray); + if($isthere >0) + { + $query = "SELECT * FROM ".TB_PREFIX."odata WHERE conqured = ".$village['wref'].""; + $result = mysql_query($query); + while($row = mysql_fetch_assoc($result)) { + $oasiswref = $row['wref']; + $oasisx = mysql_result(mysql_query("SELECT x FROM ".TB_PREFIX."wdata WHERE id = ".$oasiswref.""), 0); + $oasisy = mysql_result(mysql_query("SELECT y FROM ".TB_PREFIX."wdata WHERE id = ".$oasiswref.""), 0); + + $type = $row['type']; + if($type==1) { $type = ' + 25%'; } + elseif($type==2) { $type = ' + 25%'; } + elseif($type==3) { $type = ' + 25%
+ 25%'; } + elseif($type==4) { $type = ' + 25%'; } + elseif($type==5) { $type = ' + 25%'; } + elseif($type==6) { $type = ' + 25%
+ 25%'; } + elseif($type==7) { $type = ' + 25%'; } + elseif($type==8) { $type = ' + 25%'; } + elseif($type==9) { $type = ' + 25%
+ 25%'; } + elseif($type==10){ $type = ' + 25%'; } + elseif($type==11){ $type = ' + 25%'; } + elseif($type==12){ $type = ' + 50%'; } echo " - + - + "; - } + } ## } - elseif($result ==0) + elseif($isthere ==0) { echo ''; } @@ -272,7 +315,7 @@ if(isset($id)) ?> @@ -289,7 +332,7 @@ if(isset($id)) ?>
- -
+

@@ -365,6 +408,48 @@ if(isset($id))
+ + + + + + + + + + +
OasisOases
'.$oasisarray['name'].'('.$oasiscoor['x'].'|'.$oasiscoor['y'].')'.$oasisarray['loyalty'].''.$type.'
".$row['name']."getMapCheck($row['wref'])."\" target=\"blank\">(".$row['x']."|".$row['y'].")getMapCheck($row['wref'])."\" target=\"blank\">(".$oasisx."|".$oasisy.") ".$row['loyalty']."% $type
".$row['wood']."
".$row['clay']."
".$row['iron']."
".$row['crop']."
This village has no oases