Merge pull request #106 from akshay9/master

instant build Fix
This commit is contained in:
yi12345
2012-08-17 10:22:04 -07:00
2 changed files with 59 additions and 50 deletions
+58 -49
View File
@@ -1,61 +1,70 @@
<?php <?php
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!"); if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
include_once('ver.tpl'); include('ver.tpl');
if(isset($_GET['c'])) if(isset($_GET['c']))
{ {
copy("http://travian.gamingcrazy.net/Update/update_latest.tpl", "Templates/update_latest.tpl"); copy("http://travian.gamingcrazy.net/Update/update_latest.tpl", "Templates/update_latest.tpl");
} }
include('update_latest.tpl');
if(isset($_GET['u'])) if(isset($_GET['u']))
{ {
$dl=$ver+1; for ($dl=$ver+1; $dl<=$latest; $dl++)
$file = "http://travian.gamingcrazy.net/Update/$dl.zip";
$newfile = "update.zip";
if (!copy($file, $newfile))
{ {
echo "Failed Update"; $file = "http://travian.gamingcrazy.net/Update/$dl.zip";
$newfile = "update.zip";
if (!copy($file, $newfile))
{
echo "Update Files of Version $dl were not found.";
}
else
{
$zip = new ZipArchive;
if ($zip->open('update.zip') === TRUE)
{
$zip->extractTo('../');
$zip->close();
unlink('update.zip');
echo "Successfully Updated to Version $dl ";;
}
else
{
echo 'Failed to update to Version $dl';
}
}
} }
$zip = new ZipArchive;
if ($zip->open('update.zip') === TRUE)
{
$zip->extractTo('../');
$zip->close();
unlink('update.zip');
header("Location: admin.php?p=update&s");
} else {echo 'Update Failed';}
} }
?> ?>
<table id="member" cellpadding="1" cellspacing="1" > <table id="member" cellpadding="1" cellspacing="1" >
<thead> <thead>
<tr> <tr>
<th colspan="3">System Updates</th> <th colspan="3">System Updates</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td class="hab" colspan="2">Current Version :</td> <td class="hab" colspan="2">Current Version :</td>
<td class="hab" colspan="1"><font color="red"><?php echo "$ver"; ?></font></td> <td class="hab" colspan="1"><font color="red"><?php include('ver.tpl'); echo "$ver"; ?></font></td>
</tr> </tr>
<tr> <tr>
<td class="hab" colspan="2">Latest Version :</td> <td class="hab" colspan="2">Latest Version :</td>
<td class="hab" colspan="1"><font color="red"><?php include('update_latest.tpl'); echo "$latest" ?></font></td> <td class="hab" colspan="1"><font color="red"><?php echo "$latest"; ?></font></td>
</tr> </tr>
<tr> <tr>
<td class="hab" colspan="2">Check for Update</td> <td class="hab" colspan="2">Check for Update</td>
<td class="hab" colspan="1"><center><a href="?p=update&c"><img src="../img/admin/b/ok1.gif"></a></center></td> <td class="hab" colspan="1"><center><a href="http://travian.gamingcrazy.net/TravianZ/Admin/admin.php?p=update&c"><img src="../img/admin/b/ok1.gif"></a></center></td>
</tr> </tr>
<tr> <tr>
<td class="hab" colspan="2">Update</td> <td class="hab" colspan="2">Update</td>
<td class="hab" colspan="1"><?php <td class="hab" colspan="1"><?php
if(isset($_GET['s'])) if($latest > $ver)
{echo '<font color="red">Update Success</font>';} {
elseif($latest > $ver) echo'<center><a href="http://travian.gamingcrazy.net/TravianZ/Admin/admin.php?p=update&u"><img src="../img/admin/b/update.png"></a></center>';
{echo'<center><a href="?p=update&u"><img src="../img/admin/b/update.png"></a></center>'; } }
else { echo "No updates Avaiable";}?></td> else
</tr> {
<tr> echo "No updates Avaiable";
<td class="hab" colspan="2">Visit Forum</td> }
<td class="hab" colspan="1"><center><a href="http://travian.gamingcrazy.net/forum/"><img src="../img/admin/b/ok1.gif"></a></center></td> ?></td>
</tr> </tr>
</tbody> </tbody>
</table><br /><br /> </table>
<p><font color="red">Guys don`t forget to register at the forum to receive information of the updates"</font></p>
+1 -1
View File
@@ -698,7 +698,7 @@ class Building {
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid']; $q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
} }
} }
if($database->query($q) && ($enought_res == 1 or $jobs['master'])) { if($database->query($q) && ($enought_res = 1 or $jobs['master'])) {
$database->modifyPop($jobs['wid'],$resource['pop'],0); $database->modifyPop($jobs['wid'],$resource['pop'],0);
$database->addCP($jobs['wid'],$resource['cp']); $database->addCP($jobs['wid'],$resource['cp']);
$q = "DELETE FROM ".TB_PREFIX."bdata where id = ".$jobs['id']; $q = "DELETE FROM ".TB_PREFIX."bdata where id = ".$jobs['id'];