X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/4fa1d9c17950b2f436a42c3dd1ad158506c6501e..v4.5-23-gb9757db578:/foto/index.php diff --git a/foto/index.php b/foto/index.php index 0acd44e..c2cc95c 100644 --- a/foto/index.php +++ b/foto/index.php @@ -1,6 +1,20 @@ link; +$nav = explode('/', $rootdir); +$nav[0] = "Foto's"; # override of root 'foto' +$title = array_pop($nav); +$Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title; + +if (!$User) { + $img = "$rootdir/index.jpg"; + if (file_exists($img)) { + # cover image of current album + $Page->image = "/$img"; + } + return; +} + if ($User->admin('foto')) { if ($Page->restricted) { $access = '🔒 Bewoners'; @@ -16,11 +30,6 @@ if ($User->admin('foto')) { print "\n\n"; } -$nav = explode('/', $rootdir); -$nav[0] = "Foto's"; # override of root 'foto' -$title = array_pop($nav); -$Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title; - $link = ''; print "

"; foreach ($nav as $i => $linktitle) { @@ -34,6 +43,7 @@ if (isset($Page->raw)) { print $Page->raw; # page intro } +if (!function_exists('showthumb')) { function showthumb($path) { // assume all album entries are symlinks to archive originals @@ -51,6 +61,7 @@ function showthumb($path) return sprintf('<%s />'."\n", $target, $imgtag); } +} if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) { natsort($imgs);