Ignore:
Timestamp:
Apr 20, 2009, 9:51:07 PM (16 years ago)
Author:
barny
Message:

Upraven minimanager aby se spustil vymazal jsem uptime script :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mmadmin/index.php

    r374 r570  
    2020$output .= "<div class=\"top\">";
    2121
    22 if (test_port($server[$realm_id]['addr'],$server[$realm_id]['game_port']))
    23 {
    24     $query = $sql->query("SELECT `starttime` FROM `uptime` ORDER BY `starttime` DESC LIMIT 1");
    25     $getuptime = mysql_fetch_row($query);
    26     $uptimetime = time() - $getuptime[0];
    27     $uptime = array
    28         (
    29             'd' => $uptimetime / 86400 % 7,
    30             'h' => $uptimetime / 3600 % 24,
    31             'm' => $uptimetime / 60 % 60,
    32             's' => $uptimetime / 1 % 60,
    33          );
    34 
    35     if ($uptime['d'] < 2) $sd = ""; else $sd = "s";
    36     if ($uptime['h'] < 2) $sh = ""; else $sh = "s";
    37     if ($uptime['m'] < 2) $sm = ""; else $sm = "s";
    38     if ($uptime['s'] < 2) $ss = ""; else $ss = "s";
    39 
    40     if ($uptime['d'] > 0)
    41         $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " . $uptime['d'] . " day$sd " .  $uptime['h'] . " hour$sh " .  $uptime['m'] . " minute$sm and  " .  $uptime['s'] . " second$ss.</font></h1>";
    42     else
    43     {
    44         if ($uptime['h'] > 0)
    45             $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " .  $uptime['h'] . " hour$sh " .  $uptime['m'] . " minute$sm and  " .  $uptime['s'] . " second$ss.</font></h1>";
    46         else
    47             $output .= "<h1><font color=\"#55aa55\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['online']} for " .  $uptime['m'] . " minute$sm and  " .  $uptime['s'] . " second$ss.</font></h1>";
    48     }
    49 
    50     $online = true;
    51 }
    52 else
    53 {
    54     $output .= "<h1><font class=\"error\">{$lang_index['realm']} ".get_realm_name($realm_id)." {$lang_index['offline_or_let_high']}</font></h1>";
    55         $online = false;
    56 }
    5722
    5823//  This retrieves the actual database version from the database itself,  instead of hardcoding it into a string
Note: See TracChangeset for help on using the changeset viewer.