Skip to content

Commit

Permalink
PHP code format - (prettier)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 3, 2024
1 parent 477179d commit bb5da03
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions system/status.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@
if ($fetch_from_db) {
// get info from db
/** @var OTS_DB_MySQL $db */
$status_query = $db->query("SELECT `name`, `value` FROM `{$TABLE_PREFIX}config` WHERE {$db->fieldName('name')} LIKE '%status%'");
$status_query = $db->query(
"SELECT `name`, `value` FROM `{$TABLE_PREFIX}config` WHERE {$db->fieldName(
'name'
)} LIKE '%status%'"
);
if ($status_query->rowCount() <= 0) {
// empty, just insert it
foreach ($status as $key => $value) {
Expand Down Expand Up @@ -131,12 +135,12 @@ function updateStatus()
}

$uptime = $status['uptime'] = $serverStatus->getUptime();
$m = date("m", $uptime);
$m = $m > 1 ? "$m months, " : ($m == 1 ? "month, " : "");
$d = date("d", $uptime);
$d = $d > 1 ? "$d days, " : ($d == 1 ? "day, " : "");
$h = date("H", $uptime);
$min = date("i", $uptime);
$m = date('m', $uptime);
$m = $m > 1 ? "$m months, " : ($m == 1 ? 'month, ' : '');
$d = date('d', $uptime);
$d = $d > 1 ? "$d days, " : ($d == 1 ? 'day, ' : '');
$h = date('H', $uptime);
$min = date('i', $uptime);
$status['uptimeReadable'] = "{$m}{$d}{$h}h {$min}m";

$status['monsters'] = $serverStatus->getMonstersCount();
Expand Down

0 comments on commit bb5da03

Please sign in to comment.