Merge pull request #99 from akshay9/master

Auto Update System for TravianZ
This commit is contained in:
yi12345
2012-08-13 04:16:56 -07:00
5 changed files with 66 additions and 3 deletions
+56
View File
@@ -0,0 +1,56 @@
<?php
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
include_once('ver.tpl');
if(isset($_GET['c']))
{
copy("http://travian.gamingcrazy.net/Update/update_latest.tpl", "Templates/update_latest.tpl");
}
if(isset($_GET['u']))
{
$dl=$ver+1;
$file = "http://travian.gamingcrazy.net/Update/$dl.zip";
$newfile = "update.zip";
if (!copy($file, $newfile))
{
echo "Failed Update";
}
$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" >
<thead>
<tr>
<th colspan="3">System Updates</th>
</tr>
</thead>
<tbody>
<tr>
<td class="hab" colspan="2">Current Version :</td>
<td class="hab" colspan="1"><font color="red"><?php echo "$ver"; ?></font></td>
</tr>
<tr>
<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>
</tr>
<tr>
<td class="hab" colspan="2">Check for Update</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>
<td class="hab" colspan="2">Update</td>
<td class="hab" colspan="1"><?php
if(isset($_GET['s']))
{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>'; }
else { echo "No updates Avaiable";}?></td>
</tr>
</tbody>
</table>
+3
View File
@@ -0,0 +1,3 @@
<?php
$latest="4";
?>
+3
View File
@@ -0,0 +1,3 @@
<?php
$ver="4";
?>
+4 -3
View File
@@ -93,6 +93,7 @@ $timeformat = new timeFormatGenerator;
<a href="<?php echo HOMEPAGE; ?>">Server Homepage</a>
<a href="admin.php">Control Panel Home</a>
<a href="<?php echo SERVER; ?>dorf1.php">Return to the server</a>
<a href="?p=update"><font color="Red"><b>Server Update</font></b></a>
<br />
<a href="?action=logout">Logout</a>
<br />
@@ -102,8 +103,8 @@ $timeformat = new timeFormatGenerator;
<a href="?p=notregistered">Players Not Activated</a>
<br />
<a href="#"><b>Search</b></a>
<a href="?p=search">Search Players/Alliances/Villages/E-mails/IPs/Deleted Players</a>
<a href="?p=message">Search Messages/Battle Reports</a>
<a href="?p=search">General Search</a>
<a href="?p=message">Search IGMs/Reports</a>
<br />
<a href="#"><b>Ban</b></a>
<a href="?p=ban">Ban/Unban Players</a>
@@ -129,7 +130,7 @@ $timeformat = new timeFormatGenerator;
<br />
<a href="#"><b>Natars</b></a>
<a href="?p=natarend">Add WW Villages</a>
<a href="?p=natarbuildingplan">Add WW Buildingplan Villages</a>
<a href="?p=natarbuildingplan">Add WW Building Plan Villages</a>
<br />
<a href="#"><b>Admin:</b></a>
<a href="?p=admin_log"><font color="Red"><b>Admin Log</font></b></a>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB