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
if ($slice > 1) {
foreach ($curfiles as $index => $image) {
$tmp['n'] = $image;
$tmp['i'] = $index+1;
$tmp['t'] = $thumburl.$t->get_thumb($image);
$data['images'][] = $tmp;
$data['dirs'] = $dirs;
if (count($curfiles) > 0) {
foreach ($curfiles as $index => $image) {
$tmp['n'] = $image;
$tmp['i'] = $index+1;
$tmp['t'] = $thumburl.$t->get_thumb($image);
$data['images'][] = $tmp;
}
}
$data['dirs'] = $dirs;
Template::view('tpl/gallery.html', $data);
} else {
$data['gallery_page'] = ceil($page/$gslice);