From 2794ac0bbb1f021d85fb806851463bc585ccd1ed Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Apr 2012 14:39:44 +0300 Subject: [PATCH] start to work on gold club and edit plus/1.tpl --- GameEngine/Session.php | 1 + GameEngine/config.php | 254 ++++++++++++++++++++++++++++++++++++++ Templates/Map/mapview.tpl | 2 +- Templates/Plus/1.tpl | 4 +- Templates/Plus/15.tpl | 11 ++ Templates/Plus/3.tpl | 50 ++++++++ crop_finder.php | 2 +- install/data/sql.sql | 1 + plus.php | 5 +- 9 files changed, 324 insertions(+), 6 deletions(-) create mode 100644 GameEngine/config.php create mode 100644 Templates/Plus/15.tpl diff --git a/GameEngine/Session.php b/GameEngine/Session.php index 13585183..66bfdfcd 100644 --- a/GameEngine/Session.php +++ b/GameEngine/Session.php @@ -138,6 +138,7 @@ class Session { $this->gpack = $this->userarray['gpack']; $this->access = $this->userarray['access']; $this->plus = ($this->userarray['plus'] > $this->time); + $this->goldclub = $this->userarray['goldclub']; $this->villages = $database->getVillagesID($this->uid); $this->tribe = $this->userarray['tribe']; $this->isAdmin = $this->access >= MODERATOR; diff --git a/GameEngine/config.php b/GameEngine/config.php new file mode 100644 index 00000000..2e38cb30 --- /dev/null +++ b/GameEngine/config.php @@ -0,0 +1,254 @@ + diff --git a/Templates/Map/mapview.tpl b/Templates/Map/mapview.tpl index 049537ed..67ee93a8 100644 --- a/Templates/Map/mapview.tpl +++ b/Templates/Map/mapview.tpl @@ -207,7 +207,7 @@ while ($donnees = mysql_fetch_assoc($result2)){ x y
- plus != 0){echo " Crop Finder";}?> + goldclub != 0){echo " Crop Finder";}?>
Details
Player-
Population-
Alliance
diff --git a/Templates/Plus/1.tpl b/Templates/Plus/1.tpl index 61b55526..931479c9 100644 --- a/Templates/Plus/1.tpl +++ b/Templates/Plus/1.tpl @@ -436,6 +436,4 @@ if($session->access != BANNED){
All prices listed are final sales amounts.
- - - + \ No newline at end of file diff --git a/Templates/Plus/15.tpl b/Templates/Plus/15.tpl new file mode 100644 index 00000000..e7345c36 --- /dev/null +++ b/Templates/Plus/15.tpl @@ -0,0 +1,11 @@ +access != BANNED){ +if($session->gold >= 100) { +mysql_query("UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `username`='".$session->username."'"); +} +include("Templates/Plus/3.tpl"); +}else{ +header("Location: banned.php"); +} + ?> \ No newline at end of file diff --git a/Templates/Plus/3.tpl b/Templates/Plus/3.tpl index af71c560..a330f4aa 100644 --- a/Templates/Plus/3.tpl +++ b/Templates/Plus/3.tpl @@ -455,4 +455,54 @@ if (mysql_num_rows($MyGold)) { + + + + + + + + + + + + + + + + + + + + + + + + +
Travian Gold Club
DescriptionDurationGoldAction
+Gold Club
+Gold Club including: farmlist, merchants run three times, crop finder, master builder, trade routes and automatic send away troops before an attack. + + +
Active for the current round of the game, not including bouns production or plus additions. + Gold100 + +username."'") or die(mysql_error()); + $golds = mysql_fetch_array($MyGold); + +if (mysql_num_rows($MyGold)) { + if($golds['goldclub']==0){ + if($golds['gold'] > 99) { + echo ' + Activate'; +}else{ + echo ' + too little gold'; + +}} else { + echo 'On';} +} + ?> +
\ No newline at end of file diff --git a/crop_finder.php b/crop_finder.php index 84d76bfe..566133f7 100644 --- a/crop_finder.php +++ b/crop_finder.php @@ -10,7 +10,7 @@ include ("GameEngine/Village.php"); - if($session->plus == 0) { + if($session->goldclub == 0) { header("Location: plus.php?id=3"); } diff --git a/install/data/sql.sql b/install/data/sql.sql index 3ffe69e5..fd506ca9 100644 --- a/install/data/sql.sql +++ b/install/data/sql.sql @@ -1234,6 +1234,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` ( `desc1` text NOT NULL, `desc2` text NOT NULL, `plus` int(10) unsigned NOT NULL DEFAULT '0', + `goldclub` int(10) unsigned NOT NULL DEFAULT '0', `b1` int(10) unsigned NOT NULL DEFAULT '0', `b2` int(10) unsigned NOT NULL DEFAULT '0', `b3` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/plus.php b/plus.php index 5553f2b0..3a1bb083 100644 --- a/plus.php +++ b/plus.php @@ -111,7 +111,10 @@ include("Templates/Plus/13.tpl"); if ($id == 14) { include("Templates/Plus/14.tpl"); } -if ($id > 14) { +if ($id == 15) { +include("Templates/Plus/15.tpl"); +} +if ($id > 15) { include("Templates/Plus/3.tpl"); } ?>