Only Process Images if > 0

This commit is contained in:
seiichiro 2022-01-11 16:37:31 +01:00
parent edcffd343e
commit c109033996

View file

@ -84,13 +84,15 @@ if (count($curfiles) > 0 | count($dirs) > 0) {
// Prepare Mode Specific Data and Render Template // Prepare Mode Specific Data and Render Template
if ($slice > 1) { if ($slice > 1) {
foreach ($curfiles as $index => $image) { if (count($curfiles) > 0) {
$tmp['n'] = $image; foreach ($curfiles as $index => $image) {
$tmp['i'] = $index+1; $tmp['n'] = $image;
$tmp['t'] = $thumburl.$t->get_thumb($image); $tmp['i'] = $index+1;
$data['images'][] = $tmp; $tmp['t'] = $thumburl.$t->get_thumb($image);
$data['dirs'] = $dirs; $data['images'][] = $tmp;
}
} }
$data['dirs'] = $dirs;
Template::view('tpl/gallery.html', $data); Template::view('tpl/gallery.html', $data);
} else { } else {
$data['gallery_page'] = ceil($page/$gslice); $data['gallery_page'] = ceil($page/$gslice);