Update index.php

This commit is contained in:
deepend-tildeclub 2024-08-17 10:51:30 -06:00 committed by GitHub
parent bb38fcaf12
commit fb4c3033a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -13,12 +13,13 @@
$activeUsers = json_decode(file_get_contents('online-users.json'), true);
if (!empty($activeUsers)) {
echo "<ul>";
$userList = "";
foreach ($activeUsers as $user) {
$username = htmlspecialchars($user);
echo "<li><a href='/~$username'>$username</a></li>";
$userList .= "<li><a href='/~$username'>$username</a></li>";
}
echo "</ul>";
// Print the list with data-content for seamless scrolling
echo "<ul data-content=\"$userList\">$userList</ul>";
} else {
echo "<span>No active users at the moment.</span>";
}