From 12010ee2db293dc4d8e021bcc6bc26358ad22ee9 Mon Sep 17 00:00:00 2001 From: Stefan Brand Date: Thu, 3 Feb 2022 17:49:28 +0100 Subject: [PATCH] Make Sorting Switchable --- index.php | 5 ++++- tpl/gallery.html | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index e130b19..7f263e0 100644 --- a/index.php +++ b/index.php @@ -82,8 +82,11 @@ if (isset($_GET['f'])) { // Sort and Reverse Filelist natcasesort($files); -if ($sort == 1) +if ($sort == 1) { $files = array_reverse($files); +} else { + $files = array_values($files); +} if (!empty($dirs)) $files = array_merge($dirs, $files); diff --git a/tpl/gallery.html b/tpl/gallery.html index 14d17d5..3140b4a 100644 --- a/tpl/gallery.html +++ b/tpl/gallery.html @@ -49,7 +49,12 @@ 1 {% endif %} - {{ $page }} + + {% if ($sort == 1): %} + {{ $page }} + {% else: %} + {{ $page }} + {% endif %} {% if ($page < $last_page): %} {{ $last_page }}