From e0406f8c60a05887c2670d633d1d8eb58c7332c1 Mon Sep 17 00:00:00 2001 From: Ada Isopods Date: Thu, 5 Dec 2024 20:26:58 -0700 Subject: overhauled the entire site basically --- img/index.php | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100755 img/index.php (limited to 'img') diff --git a/img/index.php b/img/index.php new file mode 100755 index 0000000..a0e6b61 --- /dev/null +++ b/img/index.php @@ -0,0 +1,82 @@ + + + + + + + /log/img + + + + + +

$ pwd

+

/log/img

+

$ ls -t

+
+ 0 or strpos($name, ".gif") > 0 or strpos($name, ".jxl") > 0); + } + + function imagetime($file) { // This needs to return a Unix timestamp. + global $imagetimes; + if(!$imagetimes[$file]) { + $imagetimes[$file] = filemtime($file); + } + return $imagetimes[$file]; + } + + $images = array_filter(scandir("."), "test_image"); // Generate array of every image in the directory by filename + + usort($images, function($a, $b) { // Sort images by modification date of the files + return imagetime("$b") - imagetime("$a"); + }); + + $pmt = ""; + foreach($images as $im) { // Loops through each image and echoes it to the page + + $no = substr($im, 0, strpos($im, ".")); // Filename with extension stripped + $mt = date("Y-m-d", imagetime("$im")); // File modification date in ISO format + $is = getimagesize("$im"); + $ist = $is[0] . "×" . $is[1]; // Image size formatted as X×Ypx + + if($pmt != $mt) { + if($pmt != "") { + echo ""; + } + $pmt = $mt; + echo "

$mt

+

$

+ + + -- cgit v1.2.3