From 0eb08f3d2fca241bacef7e26981b37d138211da1 Mon Sep 17 00:00:00 2001 From: Lanta Date: Tue, 17 Jun 2025 16:46:51 +0200 Subject: [PATCH] k --- videos.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/videos.php b/videos.php index 3201f13..80805ef 100644 --- a/videos.php +++ b/videos.php @@ -7,6 +7,19 @@ $allFiles = scandir($videosDir); $videoFiles = array_filter($allFiles, function($file) use ($videosDir) { return is_file($videosDir . '/' . $file) && strtolower(pathinfo($file, PATHINFO_EXTENSION)) === 'mp4'; }); + +// Build array with creation time and sort by creation date descending +$videoData = []; +foreach ($videoFiles as $file) { + $path = $videosDir . '/' . $file; + $videoData[] = [ + 'filename' => $file, + 'ctime' => filectime($path) + ]; +} +usort($videoData, function($a, $b) { + return $b['ctime'] - $a['ctime']; +}); ?> @@ -20,15 +33,16 @@ $videoFiles = array_filter($allFiles, function($file) use ($videosDir) {

Videos

- +
- +
-

+

+