From 01ac46f511e85d7050a5fe00d52bb04f0973b644 Mon Sep 17 00:00:00 2001 From: Shadow Date: Tue, 24 Dec 2013 17:44:44 +0200 Subject: [PATCH] Update []inactive.tpl --- Admin/Templates/[]inactive.tpl | 136 +++++++++++++++++---------------- 1 file changed, 72 insertions(+), 64 deletions(-) diff --git a/Admin/Templates/[]inactive.tpl b/Admin/Templates/[]inactive.tpl index 9a253efb..e679713e 100644 --- a/Admin/Templates/[]inactive.tpl +++ b/Admin/Templates/[]inactive.tpl @@ -2,76 +2,84 @@ ################################################################################# ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ## ## --------------------------------------------------------------------------- ## -## Filename online.tpl ## +## Filename inactive.tpl ## ## Developed by: Dzoki ## ## Reworked: aggenkeech ## -## License: TravianX Project ## -## Copyright: TravianX (c) 2010-2012. All rights reserved. ## +## Fix by: ronix ## +## License: TravianZ Project ## +## Copyright: TravianZ (c) 2010-2013. All rights reserved. ## ## ## ################################################################################# -error_reporting(0); +global $database; ?> - - - - - - - - - - - - - - - - getUserField($active[$i]['username'],'id',1); - $varray = $database->getProfileVillages($uid); - $totalpop = 0; - foreach($varray as $vil) - { - $totalpop += $vil['pop']; - } - if($active[$i]['tribe'] == 1) - { - $tribe = "Roman"; - $img = ""; - } - else if($active[$i]['tribe'] == 2) - { - $tribe = "Teuton"; - $img = "1"; - } - else if($active[$i]['tribe'] == 3) - { - $tribe = "Gaul"; - $img = "2"; - } - echo " - - - - - - - - - "; - } - ?> - -
Inactive users
Name [access]TimeTribePopulationVillagesGold
".$active[$i]['username']." [".$active[$i]['access']."]".date("H:i:s",$active[$i]['timestamp'])."\"$tribe\"".$totalpop."".count($varray)."\"Gold\" ".$active[$i]['gold']."
\ No newline at end of file + + + Inactive users + + + Name [access] + Time + Tribe + Population + Villages + Gold + + + + + = timestamp AND $to_time < timestamp) AND id>5"; + }elseif ($h==2) { // 3 days and before 7 days + $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"; + }elseif ($h==3) { //7 days and after + $from_time=time() - (86400*7); + $q = "SELECT * FROM ".TB_PREFIX."users where $from_time > timestamp AND id>5"; + } + + $result = $database->query($q); + $active = $database->mysql_fetch_all($result); + for ($i = 0; $i <= count($active)-1; $i++){ + $uid = $database->getUserField($active[$i]['username'],'id',1); + $varray = $database->getProfileVillages($uid); + $totalpop = 0; + foreach($varray as $vil){ + $totalpop += $vil['pop']; + } + if($active[$i]['tribe'] == 1){ + $tribe = "Roman"; + $img = ""; + }else if($active[$i]['tribe'] == 2){ + $tribe = "Teuton"; + $img = "1"; + }else if($active[$i]['tribe'] == 3){ + $tribe = "Gaul"; + $img = "2"; + } + $getmin=((time()-$active[$i]['timestamp'])/60); + $gethr=((time()-$active[$i]['timestamp'])/3600); + $getday=intval((time()-$active[$i]['timestamp'])/86400); + + echo " + + ".$active[$i]['username']." [".$active[$i]['access']."] + ".$getday." days ".intval($gethr-$getday*24)." hours + \"$tribe\" + ".$totalpop." + ".count($varray)." + \"Gold\" ".$active[$i]['gold']." + + "; + } + } + ?> + +