From a95e3120fa06c7c9e27332326e96430aa41e0aff Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Mon, 14 Oct 2024 11:42:28 +0200 Subject: [PATCH] Fix bad detection for change file or folder --- public/index.php | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/public/index.php b/public/index.php index 60bafcf..985f122 100644 --- a/public/index.php +++ b/public/index.php @@ -14,25 +14,7 @@ ini_set("memory_limit", "256M"); /* Not edit this param directly - - 1 - Create /datas/config.php file. - 2 - Create $userconfig array like : - -$userConfig = [ - 'templateFile' => 'board', // Template filename (must be placed in 'public/templates' folder) - 'title' => 'NanoGal', // Text to be displayed in browser titlebar - 'description' => 'My gallery', // Use in meta tag "description" - 'author' => 'NanoGal', // Your name - 'skipObjects' => ['comment.html', '.gitkeep', 'aFolder', 'aFile.ext'], //Those files and folders will not be displayed (affects the page and the RSS feed) - 'imageCaptionPosition' => 'right', // Position of caption in lightbox - 'sortBy' => 'name', // Sort by name or date - 'orderBy' => 'desc', // Order by asc or desc - 'thumbSize' => 250, // Thumbnail height/width (square thumbs) - 'displayExifInfo' => false, // Display Exif info in caption - 'disableCache' => false, // Enable or disable cache - 'showShareLink' => false, // Show link for thumb, full, markdown link (thumb + link to full) - 'nbItemsAtom' => 25 // Number of item in atom feed -]; +See README.md */ $config = [ 'templateFile' => 'board', // Template filename (must be placed in 'public/templates' folder) @@ -76,12 +58,15 @@ if ($config['disableCache'] === false) { $cache->countDirsAndFiles(); } -if ($cache->changeFile() || $cache->changeConf() || !file_exists($cacheHash . '.html') || $config['disableCache'] === true) { +$fileChange = $cache->changeFile(); +$configChange = $cache->changeConf(); + +if ($fileChange || $configChange || !file_exists($cacheHash . '.html') || $config['disableCache'] === true) { if ($cache->changeConf()) { $cache->clearCache(); } - if($cache->changeFile() || $cache->changeConf()){ + if ($fileChange || $configChange) { Cache::clearAtomFeed(); } @@ -102,7 +87,6 @@ if ($cache->changeFile() || $cache->changeConf() || !file_exists($cacheHash . '. $userCss = ''; } - if (file_exists('templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php')) { require 'templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php'; } else {