nextcloud / unsplash

πŸ“ΈπŸ”€β˜οΈ Random Nextcloud log in background from Unsplash
https://apps.nextcloud.com/apps/unsplash
GNU Affero General Public License v3.0
92 stars 23 forks source link

source.unsplash.com does not work anymore - replace it with individual folder? #137

Closed devnull4242 closed 1 month ago

devnull4242 commented 1 month ago

source.unsplash.com does not work anymore. Apparently there is now an API that requires access data.

I suggest that you remove the entire Unsplash components and load the backgrounds from a list of your own images. This can be done with very little HTML and JavaScript code. In addition, the Splash app then requires very little maintenance.

example code:

<?php
$dir = __DIR__;
$images = glob($dir . "/*.{jpg,jpeg,png,gif}", GLOB_BRACE);
if (count($images) > 0) {
    $randomImage = $images[array_rand($images)];
    echo "<html><body>";
    echo "<img src='" . basename($randomImage) . "' alt='random image' style='max-width: 100%; height: auto;'>";
    echo "</body></html>";
} else {
    echo "No image found.";
}
?>
newhinton commented 1 month ago

The issue-template exists for a reason. This is a duplicate of multiple tickets.