This commit is contained in:
2026-03-24 15:34:04 +01:00
parent 50bf7b13a7
commit 48128e78ab
4 changed files with 57 additions and 5 deletions

View File

@@ -1,9 +1,16 @@
<?php
$files = array();
foreach (scandir("/home/") as $file) {
if (in_array($file, array('.', '..'))) continue;
$files[$file] = filemtime("/home/".$file);
foreach (scandir("/home/") as $user) {
if (in_array($user, array('.', '..'))) continue;
$public_html = "/home/$user/public_html";
// Sprawdź czy katalog public_html istnieje
if (is_dir($public_html)) {
$files[$user] = filemtime($public_html);
}
}
arsort($files);
@@ -48,8 +55,19 @@ $slogan = $slogans[rand(0, count($slogans) - 1)];
<h2>Ostatnio edytowane strony:</h2>
<p class="user_home" style="margin-bottom: 1rem">$ ls -lt /home/</p>
<?php
foreach($recent as $user => $date) {
echo "<a class=\"link\" href=\"/~".$user."/\"><p class=\"user_home\"><span>drwxr-xr-x</span><span>".rand(1,9)."</span><span>".$user."</span><span>".$user."</span><span>".rand(1,19)."</span><span>".date("M d H:i", $date)."</span><span>".$user."</span></p></a>";
echo "<a class=\"link\" href=\"/~".$user."/\">
<p class=\"user_home\">
<span>drwxr-xr-x</span>
<span>".rand(1,9)."</span>
<span>".$user."</span>
<span>".$user."</span>
<span>".rand(1,19)."</span>
<span>".date("M d H:i", $date)."</span>
<span>".$user."</span>
</p>
</a>";
}
?>

View File

@@ -22,7 +22,7 @@ Otrzymaliśmy twój formularz rejestracji. Oczekuj na dalsze informacje na swoje
$interests=htmlspecialchars($_POST["interests"]);
$pubkey=htmlspecialchars($_POST["pubkey"]);
$to = 'smoorg@tylda.org';
$to = 'register@tylda.org';
$subject = 'Rejestracja usera ' . "$nick";
$message = "Nick:\t\t$nick\n" .
"Email:\t\t$email\n" .

28
stats.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
include 'header.php';
ini_set("display_errors", "On");
error_reporting(E_ALL);
$users = array();
foreach (scandir("/home/") as $file) {
if (in_array($file, array('.', '..'))) continue;
array_push($users, $file);
}
?>
<h1>> Statystyki</h1>
<article id="content">
Statystyki z tego serwera tilde
<ul>
<li>Liczba użytkowników: <?=count($users);?></li>
<li>Liczba wiadomości na IRC: TODO </li>
<li>Liczba wiadomości na IRC dziś: TODO</li>
<li>Ostatni server load: <?=shell_exec("/usr/bin/top -n 1 | grep Load | cut -d' ' -f3,4,5");?></li>
<li>Wolny RAM: <?=shell_exec("/usr/bin/free -h | grep Mem | awk '{print \$NF}'");?>
</ul>
</article>
<?php
include 'footer.php';
?>

View File

@@ -18,3 +18,9 @@ foreach (scandir("/home/") as $file) {
</ul>
</article>
<?php
include 'footer.php';
?>