Cached Accounts
count('accounts'); ?>
diff($ago);
$diff->w = floor($diff->d / 7);
$diff->d -= $diff->w * 7;
$string = array(
'y' => 'year',
'm' => 'month',
'w' => 'week',
'd' => 'day',
'h' => 'hour',
'i' => 'minute',
's' => 'second',
);
foreach ($string as $k => &$v) {
if ($diff->$k) {
$v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');
} else {
unset($string[$k]);
}
}
if (!$full) $string = array_slice($string, 0, 1);
return $string ? implode(', ', $string) . ' ago' : 'Just now';
}
$lastsync = $database->get('config', "value", ["key" => "lastsync"]);
$cardcolor = "blue";
if ($lastsync == false) {
$cardcolor = "deep-orange";
$syncstring = "Never";
} else {
$diff = time() - $lastsync;
if ($diff > 60 * 10) {
$cardcolor = "deep-orange";
}
$syncstring = time_elapsed_string("@" . $lastsync);
}
?>