Update index.php

This commit is contained in:
deepend-tildeclub 2024-08-17 09:07:12 -06:00 committed by GitHub
parent f63ab8a9b5
commit ffd4b1278e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 2 deletions

View File

@ -165,11 +165,25 @@
"385212d5ea557a21b77af992ea1b3c1ea71d22c9", "385212d5ea557a21b77af992ea1b3c1ea71d22c9",
"b51a889545b5f065fd1ac2b8760cab0088a9dc22" "b51a889545b5f065fd1ac2b8760cab0088a9dc22"
]; ];
$oneMonthAgo = strtotime('-1 month');
foreach (glob("/home/*") as $user) { foreach (glob("/home/*") as $user) {
$index = "$user/public_html/index.html"; $index = "$user/public_html/index.html";
if (!file_exists($index) || in_array(sha1_file($index), $page_shas)) continue; if (!file_exists($index) || in_array(sha1_file($index), $page_shas)) continue;
$user = basename($user); ?>
<li><a href="/~<?=$user?>/">~<?=$user?></a></li> // Check for any recent changes in the public_html directory
$recentChange = false;
foreach (glob("$user/public_html/*") as $file) {
if (filemtime($file) > $oneMonthAgo) {
$recentChange = true;
break;
}
}
$user = basename($user);
$class = $recentChange ? 'recently-updated' : '';
?>
<li class="<?= $class ?>"><a href="/~<?=$user?>/">~<?=$user?></a></li>
<?php } ?> <?php } ?>
</ul> </ul>
</div> </div>