showing support for the unionization efforts at bandcamp
This commit is contained in:
parent
1f44464cee
commit
b4efb13a17
2 changed files with 21 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
<!--?php
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
ini_set('display_startup_errors', 1);
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
?-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
@ -81,19 +86,29 @@
|
||||||
<body>
|
<body>
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<?php
|
<?php
|
||||||
|
$imagetimes = Array();
|
||||||
|
|
||||||
function test_image($name) { // Returns true if a file is an image (png or gif), false otherwise
|
function test_image($name) { // Returns true if a file is an image (png or gif), false otherwise
|
||||||
return (strpos($name, ".png") > 0 or strpos($name, ".gif") > 0);
|
return (strpos($name, ".png") > 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
|
$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
|
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();
|
$datecounts = array();
|
||||||
foreach($images as $im) { // Generate list of dates and how many images have them
|
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]) {
|
if($datecounts[$mt]) {
|
||||||
$datecounts[$mt]++;
|
$datecounts[$mt]++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,7 +120,7 @@
|
||||||
foreach($images as $im) { // Loops through each image and echoes it to the page
|
foreach($images as $im) { // Loops through each image and echoes it to the page
|
||||||
|
|
||||||
$no = substr($im, 0, strpos($im, ".")); // Filename with extension stripped
|
$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");
|
$is = getimagesize("$im");
|
||||||
$ist = $is[0] . "×" . $is[1] . "px"; // Image size formatted as X×Ypx
|
$ist = $is[0] . "×" . $is[1] . "px"; // Image size formatted as X×Ypx
|
||||||
|
|
||||||
|
@ -120,7 +135,7 @@
|
||||||
echo "<label for='show$mt'><a style='background-image:url(thumbs/$tn.png);'><span>...</span></a></label>";
|
echo "<label for='show$mt'><a style='background-image:url(thumbs/$tn.png);'><span>...</span></a></label>";
|
||||||
$pmt = $mt;
|
$pmt = $mt;
|
||||||
}
|
}
|
||||||
$cl = " class='d$mt'";
|
$cl = " class='d$mt'";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<a href='$im' style='background-image:url(thumbs/$no.png);'$cl><span>$im<br>$mt • $ist</span></a>";
|
echo "<a href='$im' style='background-image:url(thumbs/$no.png);'$cl><span>$im<br>$mt • $ist</span></a>";
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
<a rel="me" class="bandcamp-color" href="https://deeptwisty.bandcamp.com">bandcamp</a>
|
<a rel="me" class="bandcamp-color" href="https://deeptwisty.bandcamp.com">bandcamp</a>
|
||||||
<a rel="me" class="youtube-color" href="https://www.youtube.com/@deeptwisty">youtube</a>
|
<a rel="me" class="youtube-color" href="https://www.youtube.com/@deeptwisty">youtube</a>
|
||||||
<a rel="me" class="itchio-color" href="https://deeptwisty.itch.io">itch.io</a>
|
<a rel="me" class="itchio-color" href="https://deeptwisty.itch.io">itch.io</a>
|
||||||
<a rel="me" class="patreon-color" href="https://patreon.com/deeptwisty">patreon</a>
|
<!--a rel="me" class="patreon-color" href="https://patreon.com/deeptwisty">patreon</a-->
|
||||||
</nav>
|
</nav>
|
||||||
<nav id="int">
|
<nav id="int">
|
||||||
<a class="white-color" href="/posts">posts</a>
|
<a class="white-color" href="/posts">posts</a>
|
||||||
|
@ -45,6 +45,7 @@
|
||||||
<a class="white-color" href="/noises">noises</a>
|
<a class="white-color" href="/noises">noises</a>
|
||||||
</nav>
|
</nav>
|
||||||
<a href="." style="margin-top: 1rem; font-size: 0;"><img src="images/button.png" style="width: 88px;"/></a>
|
<a href="." style="margin-top: 1rem; font-size: 0;"><img src="images/button.png" style="width: 88px;"/></a>
|
||||||
|
<p><a href="https://www.bandcampunited.org/">support bandcamp united</a></p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="secondary">
|
<section id="secondary">
|
||||||
|
|
Loading…
Reference in a new issue