feat: add active users and update user list style
This commit is contained in:
18
index.php
18
index.php
@@ -20,8 +20,26 @@ include 'header.php';
|
||||
|
||||
$slogans = file("slogans.txt");
|
||||
$slogan = $slogans[rand(0, count($slogans) - 1)];
|
||||
$activeUsers = json_decode(file_get_contents('/opt/html/online.json'), true);
|
||||
|
||||
?>
|
||||
<pre class="scroll">
|
||||
<h3>Użytkownicy online: <?php
|
||||
if (!empty($activeUsers)) {
|
||||
echo '<marquee scrollamount="3" behavior="alternate">';
|
||||
foreach ($activeUsers as $user) {
|
||||
$username = htmlspecialchars($user);
|
||||
echo "<a href='/~$username'>$username</a> ";
|
||||
}
|
||||
echo '</marquee>';
|
||||
} else {
|
||||
echo "/dev/null";
|
||||
}
|
||||
|
||||
?></h3>
|
||||
|
||||
</pre>
|
||||
|
||||
<pre class="ascii">
|
||||
/$$ /$$ /$$
|
||||
| $$ | $$ | $$
|
||||
|
||||
Reference in New Issue
Block a user