mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-05 04:14:22 +00:00
fix Templates/Build/available.tpl
This commit is contained in:
@@ -1868,12 +1868,24 @@ class MYSQL_DB {
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function getBuildingByField2($wid,$field) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return mysql_num_rows($result);
|
||||
}
|
||||
|
||||
function getBuildingByType($wid,$type) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function getBuildingByType2($wid,$type) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return mysql_num_rows($result);
|
||||
}
|
||||
|
||||
function getDorf1Building($wid) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field < 19 and master = 0";
|
||||
|
||||
@@ -43,25 +43,60 @@ $greatwarehouse = $building->getTypeLevel(38);
|
||||
$greatgranary = $building->getTypeLevel(39);
|
||||
$greatworkshop = $building->getTypeLevel(42);
|
||||
|
||||
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
|
||||
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
|
||||
$$UnderConstruction = ($$UnderConstruction == 0 ? -1 : $$UnderConstruction);
|
||||
}
|
||||
|
||||
$mainbuilding1 = $database->getBuildingByType2($village->wid,15);
|
||||
$cranny1 = $database->getBuildingByType2($village->wid,23);
|
||||
$granary1 = $database->getBuildingByType2($village->wid,11);
|
||||
$warehouse1 = $database->getBuildingByType2($village->wid,10);
|
||||
$embassy1 = $database->getBuildingByType2($village->wid,18);
|
||||
$wall1 = $database->getBuildingByField2($village->wid,40);
|
||||
$rallypoint1 = $database->getBuildingByType2($village->wid,16);
|
||||
$hero1 = $database->getBuildingByType2($village->wid,37);
|
||||
$market1 = $database->getBuildingByType2($village->wid,17);
|
||||
$barrack1 = $database->getBuildingByType2($village->wid,19);
|
||||
$cropland1 = $database->getBuildingByType2($village->wid,4);
|
||||
$grainmill1 = $database->getBuildingByType2($village->wid,8);
|
||||
$residence1 = $database->getBuildingByType2($village->wid,25);
|
||||
$academy1 = $database->getBuildingByType2($village->wid,22);
|
||||
$armoury1 = $database->getBuildingByType2($village->wid,13);
|
||||
$woodcutter1 = $database->getBuildingByType2($village->wid,1);
|
||||
$palace1 = $database->getBuildingByType2($village->wid,26);
|
||||
$claypit1 = $database->getBuildingByType2($village->wid,2);
|
||||
$ironmine1 = $database->getBuildingByType2($village->wid,3);
|
||||
$blacksmith1 = $database->getBuildingByType2($village->wid,12);
|
||||
$stable1 = $database->getBuildingByType2($village->wid,20);
|
||||
$trapper1 = $database->getBuildingByType2($village->wid,36);
|
||||
$treasury1 = $database->getBuildingByType2($village->wid,27);
|
||||
$sawmill1 = $database->getBuildingByType2($village->wid,5);
|
||||
$brickyard1 = $database->getBuildingByType2($village->wid,6);
|
||||
$ironfoundry1 = $database->getBuildingByType2($village->wid,7);
|
||||
$workshop1 = $database->getBuildingByType2($village->wid,21);
|
||||
$stonemasonslodge1 = $database->getBuildingByType2($village->wid,34);
|
||||
$townhall1 = $database->getBuildingByType2($village->wid,24);
|
||||
$tournamentsquare1 = $database->getBuildingByType2($village->wid,14);
|
||||
$bakery1 = $database->getBuildingByType2($village->wid,9);
|
||||
$tradeoffice1 = $database->getBuildingByType2($village->wid,28);
|
||||
$greatbarracks1 = $database->getBuildingByType2($village->wid,29);
|
||||
$greatstable1 = $database->getBuildingByType2($village->wid,30);
|
||||
$brewery1 = $database->getBuildingByType2($village->wid,35);
|
||||
$horsedrinkingtrough1 = $database->getBuildingByType2($village->wid,41);
|
||||
$herosmansion1 = $database->getBuildingByType2($village->wid,37);
|
||||
$greatwarehouse1 = $database->getBuildingByType2($village->wid,38);
|
||||
$greatgranary1 = $database->getBuildingByType2($village->wid,39);
|
||||
$greatworkshop1 = $database->getBuildingByType2($village->wid,42);
|
||||
|
||||
?>
|
||||
<div id="build" class="gid0"><h1>Construct new building</h1>
|
||||
<?php
|
||||
if($mainbuilding == 0 && $id != 39 && $id != 40) {
|
||||
if($mainbuilding == 0 && $mainbuilding1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/mainbuilding.tpl");
|
||||
}
|
||||
if(($cranny == 0 || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
|
||||
if((($cranny == 0 && $cranny1 == 0) || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/cranny.tpl");
|
||||
}
|
||||
if(($granary == 0 || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
|
||||
if((($granary == 0 && $granary1 == 0) || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
|
||||
include("avaliable/granary.tpl");
|
||||
}
|
||||
if($wall == 0) {
|
||||
if($wall == 0 && $wall1 == 0) {
|
||||
if($session->tribe == 1 && $id != 39) {
|
||||
include("avaliable/citywall.tpl");
|
||||
}
|
||||
@@ -78,7 +113,7 @@ if($wall == 0) {
|
||||
include("avaliable/citywall.tpl");
|
||||
}
|
||||
}
|
||||
if(($warehouse == 0 || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
|
||||
if((($warehouse == 0 && $warehouse1 == 0) || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/warehouse.tpl");
|
||||
}
|
||||
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
@@ -86,43 +121,43 @@ if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session
|
||||
}
|
||||
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("avaliable/greatgranary.tpl");
|
||||
}
|
||||
if(($trapper ==0 || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
|
||||
}
|
||||
if((($trapper == 0 && $trapper1 == 0) || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/trapper.tpl");
|
||||
}
|
||||
if($rallypoint == 0 && $id != 40) {
|
||||
if($rallypoint == 0 && $rallypoint1 == 0 && $id != 40) {
|
||||
include("avaliable/rallypoint.tpl");
|
||||
}
|
||||
if($embassy == 0 && $id != 39 && $id != 40) {
|
||||
if($embassy == 0 && $embassy1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/embassy.tpl");
|
||||
}
|
||||
//fix hero
|
||||
if($hero == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
if($hero == 0 && $hero1 == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $id != 39 && $id != 40) {
|
||||
include("avaliable/hero.tpl");
|
||||
}
|
||||
//fix barracks
|
||||
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $barrack1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/barracks.tpl");
|
||||
}
|
||||
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $id != 39 && $id != 40) {
|
||||
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $armoury1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/armoury.tpl");
|
||||
}
|
||||
if($cropland >= 5 && $grainmill == 0 && $id != 39 && $id != 40) {
|
||||
if($cropland >= 5 && $grainmill == 0 && $grainmill1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/grainmill.tpl");
|
||||
}
|
||||
//fix marketplace
|
||||
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
|
||||
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $market1 == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/marketplace.tpl");
|
||||
}
|
||||
//fix residence
|
||||
if($mainbuilding >= 5 && $residence == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $palace == 0) {
|
||||
if($mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $id != 39 && $id != 40 && $palace == 0 && $palace1 == 0) {
|
||||
include("avaliable/residence.tpl");
|
||||
}
|
||||
if($academy == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
|
||||
if($academy == 0 && $academy1 == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/academy.tpl");
|
||||
}
|
||||
//fix palace
|
||||
if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0) {
|
||||
if($palace == 0 && $palace1 == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0 && $residence1 == 0) {
|
||||
|
||||
//Fix Castle
|
||||
//id user
|
||||
@@ -156,55 +191,55 @@ if (!$test){
|
||||
|
||||
//end Fix
|
||||
}
|
||||
if($blacksmith == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
|
||||
if($blacksmith == 0 && $blacksmith1 == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/blacksmith.tpl");
|
||||
}
|
||||
if($stonemasonslodge == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) {
|
||||
if($stonemasonslodge == 0 && $stonemasonslodge1 == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) {
|
||||
include("avaliable/stonemason.tpl");
|
||||
}
|
||||
if($stable == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
|
||||
if($stable == 0 && $stable1 == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/stable.tpl");
|
||||
}
|
||||
if($treasury == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
|
||||
if($treasury == 0 && $treasury1 == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/treasury.tpl");
|
||||
}
|
||||
if($brickyard == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
|
||||
if($brickyard == 0 && $brickyard1 == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
|
||||
include("avaliable/brickyard.tpl");
|
||||
}
|
||||
if($sawmill == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
if($sawmill == 0 && $sawmill1 == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/sawmill.tpl");
|
||||
}
|
||||
if($ironfoundry == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
if($ironfoundry == 0 && $ironfoundry1 == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/ironfoundry.tpl");
|
||||
}
|
||||
if($workshop == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
if($workshop == 0 && $workshop1 == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/workshop.tpl");
|
||||
}
|
||||
if($tournamentsquare == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
|
||||
if($tournamentsquare == 0 && $tournamentsquare1 == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
|
||||
include("avaliable/tsquare.tpl");
|
||||
}
|
||||
if($bakery == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
if($bakery == 0 && $bakery1 == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
|
||||
include("avaliable/bakery.tpl");
|
||||
}
|
||||
if($townhall == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
|
||||
if($townhall == 0 && $townhall1 == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/townhall.tpl");
|
||||
}
|
||||
if($tradeoffice == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
|
||||
if($tradeoffice == 0 && $tradeoffice1 == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
|
||||
include("avaliable/tradeoffice.tpl");
|
||||
}
|
||||
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
|
||||
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $horsedrinkingtrough1 == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
|
||||
include("avaliable/horsedrinking.tpl");
|
||||
}
|
||||
if($session->tribe == 2 && $brewery == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
|
||||
if($session->tribe == 2 && $brewery == 0 && $brewery1 == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
|
||||
include("avaliable/brewery.tpl");
|
||||
}
|
||||
if($greatbarracks == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
if($greatbarracks == 0 && $greatbarracks1 == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/greatbarracks.tpl");
|
||||
}
|
||||
if($greatstable == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
if($greatstable == 0 && $greatstable1 == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
|
||||
include("avaliable/greatstable.tpl");
|
||||
}
|
||||
if($greatworkshop == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) {
|
||||
if($greatworkshop == 0 && $greatworkshop1 == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) {
|
||||
include("avaliable/greatworkshop.tpl");
|
||||
}
|
||||
if($id != 39 && $id != 40) {
|
||||
@@ -213,19 +248,19 @@ if($id != 39 && $id != 40) {
|
||||
|
||||
<div id="build_list_soon" class="hide">
|
||||
<?php
|
||||
if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0 ) {
|
||||
if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0) {
|
||||
include("soon/trapper.tpl");
|
||||
}
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) {
|
||||
include("soon/greatwarehouse.tpl");
|
||||
}
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) {
|
||||
include("soon/greatgranary.tpl");
|
||||
}
|
||||
if($hero == 0 && ($mainbuilding <= 2 || $rallypoint == 0)){
|
||||
include("soon/hero.tpl");
|
||||
}
|
||||
if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2) ) {
|
||||
if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2)) {
|
||||
include("soon/barracks.tpl");
|
||||
}
|
||||
if($armoury == 0 && ($mainbuilding <= 2 || $academy == 0)) {
|
||||
@@ -237,13 +272,13 @@ if($cropland <= 4) {
|
||||
if($marketplace == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
|
||||
include("soon/marketplace.tpl");
|
||||
}
|
||||
if($residence == 0 && $mainbuilding <= 4) {
|
||||
if($residence == 0 && $palace == 0 && $mainbuilding <= 4) {
|
||||
include("soon/residence.tpl");
|
||||
}
|
||||
if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) {
|
||||
include("soon/academy.tpl");
|
||||
}
|
||||
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4) {
|
||||
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $palace == 0 && $residence == 0) {
|
||||
|
||||
//Fix Castle
|
||||
//id user
|
||||
|
||||
Reference in New Issue
Block a user