Update []inactive.tpl

This commit is contained in:
Shadow
2013-12-24 17:44:44 +02:00
parent 89fa5ec11b
commit 01ac46f511
+72 -64
View File
@@ -2,76 +2,84 @@
################################################################################# #################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ## ## --------------------------------------------------------------------------- ##
## Filename online.tpl ## ## Filename inactive.tpl ##
## Developed by: Dzoki ## ## Developed by: Dzoki ##
## Reworked: aggenkeech ## ## Reworked: aggenkeech ##
## License: TravianX Project ## ## Fix by: ronix ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2013. All rights reserved. ##
## ## ## ##
################################################################################# #################################################################################
error_reporting(0); global $database;
?> ?>
<style> <style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);} .del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style> </style>
<table id="member"> <table id="member">
<thead> <thead>
<tr> <tr>
<th colspan="7">Inactive users</th> <th colspan="7">Inactive users</th>
</tr> </tr>
<tr> <tr>
<td>Name [access]</td> <td>Name [access]</td>
<td>Time</td> <td>Time</td>
<td>Tribe</td> <td>Tribe</td>
<td>Population</td> <td>Population</td>
<td>Villages</td> <td>Villages</td>
<td>Gold</td> <td>Gold</td>
<td></td> <td></td>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$inactivei = time() - 86400; for ($h=1;$h<4;$h++) {
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp < $inactivei AND access=2"; if ($h==1) { // 24 hours and before 3 days
$result = mysql_query($q); $from_time=time() - 86400; $to_time = time() - (86400*3);
$active = mysql_fetch_assoc($result); $q = "SELECT * FROM ".TB_PREFIX."users where ($from_time >= timestamp AND $to_time < timestamp) AND id>5";
}elseif ($h==2) { // 3 days and before 7 days
for ($i = 0; $i <= count($active)-1; $i++) $from_time=time() - (86400*3); $to_time = time() - (86400*7);
{ $q = "SELECT * FROM ".TB_PREFIX."users where ($from_time >= timestamp AND $to_time < timestamp) AND id>5";
$uid = $database->getUserField($active[$i]['username'],'id',1); }elseif ($h==3) { //7 days and after
$varray = $database->getProfileVillages($uid); $from_time=time() - (86400*7);
$totalpop = 0; $q = "SELECT * FROM ".TB_PREFIX."users where $from_time > timestamp AND id>5";
foreach($varray as $vil) }
{
$totalpop += $vil['pop']; $result = $database->query($q);
} $active = $database->mysql_fetch_all($result);
if($active[$i]['tribe'] == 1) for ($i = 0; $i <= count($active)-1; $i++){
{ $uid = $database->getUserField($active[$i]['username'],'id',1);
$tribe = "Roman"; $varray = $database->getProfileVillages($uid);
$img = ""; $totalpop = 0;
} foreach($varray as $vil){
else if($active[$i]['tribe'] == 2) $totalpop += $vil['pop'];
{ }
$tribe = "Teuton"; if($active[$i]['tribe'] == 1){
$img = "1"; $tribe = "Roman";
} $img = "";
else if($active[$i]['tribe'] == 3) }else if($active[$i]['tribe'] == 2){
{ $tribe = "Teuton";
$tribe = "Gaul"; $img = "1";
$img = "2"; }else if($active[$i]['tribe'] == 3){
} $tribe = "Gaul";
echo " $img = "2";
<tr> }
<td><a href=\"?p=player&uid=".$uid."\">".$active[$i]['username']." [".$active[$i]['access']."]</a></td> $getmin=((time()-$active[$i]['timestamp'])/60);
<td>".date("H:i:s",$active[$i]['timestamp'])."</td> $gethr=((time()-$active[$i]['timestamp'])/3600);
<td><img src=\"../../gpack/travian_default/img/u/".$img."9.gif\" title=\"$tribe\" alt=\"$tribe\"></td> $getday=intval((time()-$active[$i]['timestamp'])/86400);
<td>".$totalpop."</td>
<td>".count($varray)."</td> echo "
<td><img src=\"../img/admin/gold.gif\" class=\"gold\" alt=\"Gold\" title=\"This user has: ".$active[$i]['gold']." gold\"/> ".$active[$i]['gold']."</td> <tr>
<td><img src=\"../gpack/travian_default/img/a/online1.gif\"></td> <td><a href=\"?p=player&uid=".$uid."\">".$active[$i]['username']." [".$active[$i]['access']."]</a></td>
</tr>"; <td>".$getday." days ".intval($gethr-$getday*24)." hours</td>
} <td><img src=\"../gpack/travian_default/img/u/".$img."9.gif\" title=\"$tribe\" alt=\"$tribe\"></td>
?> <td>".$totalpop."</td>
</tbody> <td>".count($varray)."</td>
</table> <td><img src=\"../img/admin/gold.gif\" class=\"gold\" alt=\"Gold\" title=\"This user has: ".$active[$i]['gold']." gold\"/> ".$active[$i]['gold']."</td>
<td><img src=\"../gpack/travian_default/img/a/online".($h+2).".gif\"></td>
</tr>";
}
}
?>
</tbody>
</table>