diff --git a/index.php b/index.php index d3b59e9..6a5470e 100644 --- a/index.php +++ b/index.php @@ -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);