From b4efb13a17a91cc3bcdadfd02168f63d15513af6 Mon Sep 17 00:00:00 2001 From: will Date: Thu, 16 Mar 2023 23:38:54 -0600 Subject: [PATCH] showing support for the unionization efforts at bandcamp --- art/index.php | 23 +++++++++++++++++++---- index.php | 3 ++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/art/index.php b/art/index.php index ae7da21..0a54249 100644 --- a/art/index.php +++ b/art/index.php @@ -1,3 +1,8 @@ + @@ -81,19 +86,29 @@
0 or strpos($name, ".gif") > 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 filemtime("$b") - filemtime("$a"); + return imagetime("$b") - imagetime("$a"); }); $datecounts = array(); foreach($images as $im) { // Generate list of dates and how many images have them - $mt = date("Y-m-d", filemtime("$im")); // File modification date in ISO format + $mt = date("Y-m-d", imagetime("$im")); // File modification date in ISO format if($datecounts[$mt]) { $datecounts[$mt]++; } else { @@ -105,7 +120,7 @@ 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", filemtime("$im")); // File modification date in ISO format + $mt = date("Y-m-d", imagetime("$im")); // File modification date in ISO format $is = getimagesize("$im"); $ist = $is[0] . "×" . $is[1] . "px"; // Image size formatted as X×Ypx @@ -120,7 +135,7 @@ echo ""; $pmt = $mt; } - $cl = " class='d$mt'"; + $cl = " class='d$mt'"; } echo "$im
$mt • $ist
"; diff --git a/index.php b/index.php index 0eb954a..e3d03a9 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,7 @@ bandcamp youtube itch.io - patreon + +

support bandcamp united