mirror of
https://github.com/tildeclub/site.git
synced 2026-01-23 21:40:18 +00:00
Simplify active users scroller and prevent loop from finishing early
This commit is contained in:
43
index.php
43
index.php
@@ -18,29 +18,28 @@ if (isset($_GET['notice'])) {
|
||||
|
||||
<!-- <p class="advisory">GMAIL USERS: We no longer accept gmail.com addresses for signups since you would not receive your account information email.</p> -->
|
||||
<!-- Active Users Scrolling List -->
|
||||
<div class="active-users-container">
|
||||
<h2 style="display: inline;">Currently Active Users:</h2>
|
||||
<div class="active-users-list">
|
||||
<ul>
|
||||
<?php
|
||||
$activeUsers = json_decode(file_get_contents('online-users.json'), true);
|
||||
<div id="active-users">
|
||||
<h2>Currently Active Users:</h2>
|
||||
<?php
|
||||
$activeUsers = json_decode(file_get_contents('/usr/share/nginx/html/online-users.json'), true);
|
||||
|
||||
if (!empty($activeUsers)) {
|
||||
foreach ($activeUsers as $user) {
|
||||
$username = htmlspecialchars($user);
|
||||
echo "<li><a href='/~$username'>$username</a></li>";
|
||||
}
|
||||
// Repeat the list for seamless scrolling
|
||||
foreach ($activeUsers as $user) {
|
||||
$username = htmlspecialchars($user);
|
||||
echo "<li><a href='/~$username'>$username</a></li>";
|
||||
}
|
||||
} else {
|
||||
echo "<li>No active users at the moment.</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
if (!empty($activeUsers))
|
||||
{
|
||||
echo '<marquee scrollamount="2">';
|
||||
|
||||
foreach ($activeUsers as $user)
|
||||
{
|
||||
$username = htmlspecialchars($user);
|
||||
echo "<a href='/~$username'>$username</a> ";
|
||||
}
|
||||
|
||||
echo '</marquee>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<li>No active users at the moment.</li>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div class="row">
|
||||
|
||||
Reference in New Issue
Block a user