feat: add icon for user status

This commit is contained in:
Baoshuo Ren 2022-10-04 16:42:59 +08:00
parent 2af4a869f3
commit fd9cc2b302
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -139,18 +139,21 @@ function fTime($time, $gran = -1) {
<div class="card-footer bg-transparent"> <div class="card-footer bg-transparent">
<?php $last_visited = strtotime($user['last_visited']) ?> <?php $last_visited = strtotime($user['last_visited']) ?>
<?php if (time() - $last_visited < 60 * 15): // 15 mins ?> <?php if (time() - $last_visited < 60 * 15): // 15 mins ?>
<span class="text-success fw-bold"> <span class="text-success">
<i class="bi bi-circle-fill"></i>
<?= UOJLocale::get('online') ?> <?= UOJLocale::get('online') ?>
</span> </span>
<?php elseif ($last_visited > 0): ?>
<span class="text-muted">
<?= UOJLocale::get('last active at') ?>
<?= fTime($last_visited, 0) ?>
</span>
<?php else: ?> <?php else: ?>
<span class="text-muted"> <span class="text-danger">
<i class="bi bi-circle-fill"></i>
<?= UOJLocale::get('offline') ?> <?= UOJLocale::get('offline') ?>
</span> </span>
<?php if ($last_visited > 0): ?>
<span class="text-muted">
, <?= UOJLocale::get('last active at') ?>
<?= fTime($last_visited, 0) ?>
</span>
<?php endif ?>
<?php endif ?> <?php endif ?>
</div> </div>
</div> </div>