diff --git a/www/galleri/index.php b/www/galleri/index.php index b626216..bd87474 100644 --- a/www/galleri/index.php +++ b/www/galleri/index.php @@ -52,6 +52,14 @@ function getDirContents($dir, &$results = array()) { } $images = getDirContents($galleryDir); +function cmpModifyTime($a, $b) { + $mtime_a = filemtime($galleryDir . $a); + $mtime_b = filemtime($galleryDir . $b); + return ($mtime_a > $mtime_b); +} + +usort($images, "cmpModifyTime"); + $imageTemplate = '
@@ -105,7 +113,6 @@ $imageTemplate = ' $vars = [ "%user" => htmlspecialchars($imguser), "%time" => $modTime, - "%timestamp" => filemtime($galleryDir . $value), "%name" => htmlspecialchars($displaypath), "%path" => $serverPath . $value, "%thumbnail" => $serverPath . "/.thumbnails" . $value . ".png", diff --git a/www/js/slideshow.js b/www/js/slideshow.js index ac27a9f..eb12e18 100644 --- a/www/js/slideshow.js +++ b/www/js/slideshow.js @@ -21,7 +21,7 @@ function stepSlideshow(imgs) { //Change source to next picture after it is faded out slideshowIndex = (slideshowIndex + 1) % imgs.length; ssi2.src = slideshowFnames[slideshowIndex]; - }, 800); + }, 1000); } //Initialize slideshow, start interval @@ -29,4 +29,4 @@ if (slideshowFnames.length > 1) { slideshowInterval = setInterval(()=>{ stepSlideshow(slideshowFnames); }, SLIDESHOWDELAYMS); -} \ No newline at end of file +}