*/ $logtime = explode(".", $online_history); $history_off = 0; $history_on = 0; foreach ($logtime as $log) { if (strstr($log, "-")) { $history_off = $history_off + substr($log, 1); } else { $history_on = $history_on + $log; } } $DIV_history_off = ""; if ($history_off > 0) { $DIV_history_off = "<FONT color=red>" . formatted_timediff($history_off * 60) . "</FONT>"; } $DIV_history_total = formatted_timediff(($history_off + $history_on) * 60); if ($history_off > 0) { format1("Uptime", procentColor(procentOnline($sh_host)) . " [ " . $DIV_history_off . " / " . $DIV_history_total . " ]"); } else { format1("Uptime", procentColor(procentOnline($sh_host)) . " [ " . $DIV_history_total . " ]"); } if ($country_whois == true && $tara_code["tara"] != "<>") { format1("ISP Info", $tara_code["info"]); } echo "<BR>"; ob_flush(); flush(); $LastPingError = "Very slow"; $pingCount = 5; $pingCountOK = 0; $pingLast = 0;
function get_formatted_timediff($then, $now = false) { $now = !$now ? time() : $now; $timediff = $now - $then; $str = formatted_timediff($timediff); return $str; }