Call the png in Tinfoil theme settings.json:
https://yourdomain.com/images/halloween.png
Create a .htaccess file on the hosting server inside a folder called "images":
RewriteEngine On
RewriteRule ^halloween\.png$ halloween.php [L]
Inside that same "images" folder, create a folder named "halloween" and a text file named "halloween.php"
Dump all your png images into that halloween folder.
Edit the "halloween.php" file to include:
<?php
// Define the directory where your PNG images are stored
$imageDirectory = 'halloween/';
// Get a list of all PNG files in the directory
$pngFiles = glob($imageDirectory . '*.png');
// Check if there are any PNG files in the directory
if (count($pngFiles) > 0) {
// Select a random PNG file from the list
$randomImage = $pngFiles[array_rand($pngFiles)];
// Set the appropriate Content-Type header
header('Content-Type: image/png');
// Output the selected image
readfile($randomImage);
} else {
// If no PNG files are found, display an error message
echo 'No PNG images found in the directory.';
}
?>
Restart the server to pick up the new htaccess file (may or may not be necessary).