Update index.php

This commit is contained in:
deepend-tildeclub 2024-11-01 16:38:21 -06:00 committed by GitHub
parent f1c971e910
commit 4c7113dd74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 11 deletions

View File

@ -204,18 +204,22 @@ if (isset($_GET['notice'])) {
]; ];
$oneMonthAgo = strtotime('-1 month'); $oneMonthAgo = strtotime('-1 month');
foreach (glob("/home/*") as $user) { foreach (glob("/home/*") as $user) {
$index = "$user/public_html/index.html"; // Look for index files with common extensions
if (!file_exists($index) || in_array(sha1_file($index), $page_shas)) continue; $indexFiles = glob("$user/public_html/index.{html,htm,php}", GLOB_BRACE);
$index = count($indexFiles) > 0 ? $indexFiles[0] : null;
// Check for any recent changes in the public_html directory if (!$index || in_array(sha1_file($index), $page_shas)) continue;
$recentChange = false;
foreach (glob("$user/public_html/*") as $file) { // Check for any recent changes in the public_html directory
if (filemtime($file) > $oneMonthAgo) { $recentChange = false;
$recentChange = true; foreach (glob("$user/public_html/*") as $file) {
break; if (filemtime($file) > $oneMonthAgo) {
} $recentChange = true;
} break;
}
}
}
$user = basename($user); $user = basename($user);
$class = $recentChange ? 'recently-updated' : ''; $class = $recentChange ? 'recently-updated' : '';