forked from tylda-public/main
feat: add active users and update user list style
This commit is contained in:
45
users.php
45
users.php
@@ -1,20 +1,45 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
include 'header.php';
|
||||
|
||||
$activeUsers = json_decode(file_get_contents('/opt/html/online.json'), true);
|
||||
|
||||
?>
|
||||
<h1>> Users </h1>
|
||||
<article id="content">
|
||||
Lista użytkowników i linki do ich blogów
|
||||
Lista użytkowników obecnie aktywnych:
|
||||
|
||||
<div class="user-list">
|
||||
<?php
|
||||
|
||||
if (!empty($activeUsers)) {
|
||||
foreach ($activeUsers as $user) {
|
||||
$username = htmlspecialchars($user);
|
||||
echo "<a class=\"users\" href='/~$username'>$username</a>";
|
||||
}
|
||||
} else {
|
||||
echo "...";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
Lista użytkowników i linki do ich blogów:
|
||||
<ul>
|
||||
<?php
|
||||
$host=htmlspecialchars($_SERVER['SERVER_NAME']);
|
||||
//$host="";
|
||||
foreach (scandir("/home/") as $file) {
|
||||
if (in_array($file, array('.', '..'))) continue;
|
||||
echo "<li><a href=\"/~$file\">~$file</a></li>";
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="user-list">
|
||||
<?php
|
||||
$host=htmlspecialchars($_SERVER['SERVER_NAME']);
|
||||
//$host="";
|
||||
foreach (scandir("/home/") as $file) {
|
||||
if (in_array($file, array('.', '..'))) continue;
|
||||
echo "<a href=\"/~$file\">$file</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user