gallery: sort by timestamp. slideshow: fix transition bug on firefox
This commit is contained in:
parent
faf93cc45a
commit
f05765c073
@ -52,6 +52,14 @@ function getDirContents($dir, &$results = array()) {
|
|||||||
}
|
}
|
||||||
$images = getDirContents($galleryDir);
|
$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 = '
|
$imageTemplate = '
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-image-div">
|
<div class="card-image-div">
|
||||||
@ -105,7 +113,6 @@ $imageTemplate = '
|
|||||||
$vars = [
|
$vars = [
|
||||||
"%user" => htmlspecialchars($imguser),
|
"%user" => htmlspecialchars($imguser),
|
||||||
"%time" => $modTime,
|
"%time" => $modTime,
|
||||||
"%timestamp" => filemtime($galleryDir . $value),
|
|
||||||
"%name" => htmlspecialchars($displaypath),
|
"%name" => htmlspecialchars($displaypath),
|
||||||
"%path" => $serverPath . $value,
|
"%path" => $serverPath . $value,
|
||||||
"%thumbnail" => $serverPath . "/.thumbnails" . $value . ".png",
|
"%thumbnail" => $serverPath . "/.thumbnails" . $value . ".png",
|
||||||
|
@ -21,7 +21,7 @@ function stepSlideshow(imgs) {
|
|||||||
//Change source to next picture after it is faded out
|
//Change source to next picture after it is faded out
|
||||||
slideshowIndex = (slideshowIndex + 1) % imgs.length;
|
slideshowIndex = (slideshowIndex + 1) % imgs.length;
|
||||||
ssi2.src = slideshowFnames[slideshowIndex];
|
ssi2.src = slideshowFnames[slideshowIndex];
|
||||||
}, 800);
|
}, 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Initialize slideshow, start interval
|
//Initialize slideshow, start interval
|
||||||
|
Loading…
Reference in New Issue
Block a user