Update index.php

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

View File

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