<?php
$rootdir = $Page->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 = '<span class="icon icon-locked">🔒</span> Bewoners';
print "<aside>$access</aside>\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 "<h2>";
foreach ($nav as $i => $linktitle) {
print $Page->raw; # page intro
}
+if (!function_exists('showthumb')) {
function showthumb($path)
{
// assume all album entries are symlinks to archive originals
return sprintf('<a href="/%s"><%s /></a>'."\n", $target, $imgtag);
}
+}
if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
natsort($imgs);