Not to irritate you or something.. but when will that be?dmzx wrote: 14 Jan 2018, 11:53 These are special edits that i made on this forum.
Will check to include in next version.


Not to irritate you or something.. but when will that be?dmzx wrote: 14 Jan 2018, 11:53 These are special edits that i made on this forum.
Will check to include in next version.
Yeeessdmzx wrote: 14 Jan 2018, 11:53 These are special edits that i made on this forum.
Will check to include in next version.
Code: Select all
public function main($event)
{
function format_uptime($seconds) {
$secs = intval($seconds % 60);
$mins = intval($seconds / 60 % 60);
$hours = intval($seconds / 3600 % 24);
$days = intval($seconds / 86400);
if ($days > 0) {
$uptimeString .= $days;
$uptimeString .= (($days == 1) ? " day" : " days");
}
if ($hours > 0) {
$uptimeString .= (($days > 0) ? ", " : "") . $hours;
$uptimeString .= (($hours == 1) ? " hour" : " hours");
}
if ($mins > 0) {
$uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins;
$uptimeString .= (($mins == 1) ? " minute" : " minutes");
}
if ($secs > 0) {
$uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs;
$uptimeString .= (($secs == 1) ? " second" : " seconds");
}
return $uptimeString;
}
preg_match("(\d{1,2}/\d{1,2}/\d{4}\s+\d{1,2}\:\d{2}\s+\w{2})", $winstats, $matches);
$uptimeindex = time() - strtotime($matches[0]);
$daysindex = floor($uptimeindex/60/60/24);
$hoursindex = $uptimeindex/60/60%24;
$minsindex = $uptimeindex/60%60;
$secsindex = $uptimeindex%60;
$load = sys_getloadavg();
$os = php_uname('s') . ' ' . php_uname('r');
$this->template->assign_vars(array(
'UPTIME_DAYS' => $daysindex,
'UPTIME_HOURS' => $hoursindex,
'UPTIME_MINS' => $minsindex,
'UPTIME_SECS' => $secsindex,
'AVG_LOAD0' => $load[0],
'AVG_LOAD1' => $load[1],
'AVG_LOAD2' => $load[2],
'PHP_OS' => $os,
'BOARD_VERSION' => $this->config['version'],
));
}