fixed bugs from the list of NarcisRO and more

This commit is contained in:
unknown
2012-05-23 20:44:10 +03:00
parent b8c8643133
commit ba723dce9d
23 changed files with 122 additions and 75 deletions
+3
View File
@@ -31,6 +31,9 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
echo "<b>";
echo "<a href='build.php?id=26&cancel=1'><img src='img/x.gif' class='del' title='cancel' alt='cancel'></a> ";
echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": <span id=timer1>".$generator->getTimeFormat($Demolition['timetofinish']-time())."</span>";
?>
<a href="?buildingFinish=1" onclick="return confirm('Finish all construction and research orders in this village immediately for 2 Gold?');" title="Finish all construction and research orders in this village immediately for 2 Gold?"><img class="clock" alt="Finish all construction and research orders in this village immediately for 2 Gold?" src="img/x.gif"/></a>
<?php
echo "</b>";
} else {
echo "
+1 -1
View File
@@ -86,7 +86,7 @@ include("next.tpl");
</tr>
</tbody>
</table>
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></form></p>
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></p></form>
<?php
} else {
echo "<b>Training can commence when trapper are completed.</b><br>\n";
+8 -7
View File
@@ -573,12 +573,10 @@ $output.="<tr>
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u6['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `wood` - ".$u6['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `wood` - ".$u6['crop']." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
}
}
}
if($session->tribe == 2){
if($_GET['train'] == 11){
if($session->access != BANNED){
@@ -590,7 +588,10 @@ $output.="<tr>
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `clay` = `clay` - ".$u11['clay']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `iron` = `wood` - ".$u11['iron']." WHERE `wref` = '" . $village->wid . "'");
mysql_query("UPDATE " . TB_PREFIX . "vdata SET `crop` = `wood` - ".$u11['crop']." WHERE `wref` = '" . $village->wid . "'");
header("Location: build.php?id=".$id."");
header("Location: build.php?id=".$id."");
}else{
header("Location: banned.php");
}
}
if($_GET['train'] == 12){
if($session->access != BANNED){
@@ -730,7 +731,7 @@ $output.="<tr>
}
}
}
}
+7 -1
View File
@@ -44,7 +44,13 @@ $greatgranary = $building->getTypeLevel(39);
$greatworkshop = $building->getTypeLevel(42);
$ww = $building->getTypeLevel(40);
$wwinbuild = count($database->getBuildingByType($village->wid,40));
$wwbuildingplan = count($database->getOwnArtefactInfoByType2($village->wid,11));
$wwvillages = $database->getVillagesID($session->uid);
foreach($wwvillages as $wwvillage){
$plan = count($database->getOwnArtefactInfoByType2($wwvillage,11));
if($plan > 0){
$wwbuildingplan += 1;
}
}
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
+11 -7
View File
@@ -2,25 +2,25 @@
$bid = $village->resarray['f'.$id.'t'];
$bindicate = $building->canBuild($id,$bid);
$wwlevel = $village->resarray['f'.$id];
if($wwlevel > 49){
if($wwlevel > 50){
$needed_plan = 1;
}else{
$needed_plan = 0;
}
$alli_users = $database->getUserByAlliance($session->alliance);
$wwbuildingplan = 0;
if(!empty($alli_users)){
foreach($alli_users as $users){
$villages = $database->getVillageID($users['id']);
foreach($villages as $village){
$plan = count($database->getOwnArtefactInfoByType2($village,11));
$villages = $database->getVillagesID($users['id']);
foreach($villages as $village1){
$plan = count($database->getOwnArtefactInfoByType2($village1,11));
if($plan > 0){
$wwbuildingplan += 1;
}
}
}
}
if($wwbuildingplan == $needed_plan){
if($wwbuildingplan > $needed_plan){
if($bindicate == 1) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
} else if($bindicate == 10) {
@@ -149,8 +149,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}
}else{
if($needed_plan == 0){
echo "<span class=\"none\">Need WW construction plan.</span>";
}else{
echo "<span class=\"none\">Need more WW construction plan.</span>";
}
}
?>