'board', // Template filename (must be placed in '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 'displayExifInfo' => false, // Display Exif info in caption 'thumbSize' => 300, // Thumbnail height/width (square thumbs) 'disableCache' => false, // Enable or disable cache ]; */ $config = [ '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) ]; if (file_exists('../datas/config.php')) { include '../datas/config.php'; $config = array_merge($config, $userConfig); } $messages = ''; if (!function_exists('exif_read_data') && $config['displayExifInfo'] === true) { $display_exif = 0; $messages = "Error: PHP EXIF is not available. Set $display_exif = 0; in config.php to remove this message"; } $requestedDir = ''; if (!empty($_GET['dir'])) { $requestedDir = $_GET['dir']; } $thumbdir = rtrim('photos' . $requestedDir, '/'); $current_dir = $thumbdir; $cache = new Cache($current_dir, $config); if ($config['disableCache'] === false) { $cacheHash = '../cache/html/' . md5($current_dir); $cache->countDirsAndFiles(); } if ($cache->changeFile() || $cache->changeConf() || !file_exists($cacheHash . '.html') || $config['disableCache'] === true) { if ($cache->changeConf()) { $cache->clearCache(); } if ($config['disableCache'] !== true) { $cache->save(); } $list = new FileAndDir($current_dir, $requestedDir, $config); $listDir = $list->listDirs(); $folderNote = $list->getFolderNote(); $breadcrumb_navigation = $list->makeBreadcrumb(); ob_start(); $userCss = ''; // If user set personal css rule, load it if (file_exists('../datas/user.css')) { $userCss = ''; } // If template exist load it or load default template if (file_exists('templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php')) { require 'templates/' . $config['templateFile'] . '/' . $config['templateFile'] . '.php'; } else { require 'templates/board/board.php'; } $content = ob_get_contents(); $gen = 'Build in : '; if ($config['disableCache'] === false) { file_put_contents($cacheHash . '.html', $content); } ob_end_clean(); } else { $gen = 'Serve from cache in : '; $content = file_get_contents($cacheHash . '.html'); } $time_end = microtime(true); $executionTime = round(($time_end - $time_start), 5); $content = preg_replace("/<% buildTime %>/", $gen . $executionTime . 's', $content); echo $content;