2 $intro = ob_get_clean();
4 $rootdir = $Page . $Args;
6 if (!empty($User['admin'])) {
7 $access = '🔓 Openbaar';
8 if (isset($PageAccess)) {
9 $access = "🔒 Bewoners";
10 if ($PageAccess != $rootdir) {
11 $access .= sprintf(' vanaf <a href="%s">%s</a>',
12 "/$PageAccess", pathinfo($PageAccess, PATHINFO_FILENAME)
16 print "<aside>$access</aside>\n\n";
19 $nav = explode('/', $rootdir);
20 $nav[0] = "Foto's"; # override of root 'foto'
21 $title = array_pop($nav);
25 foreach ($nav as $i => $linktitle) {
26 $link .= '/' . ($i ? $linktitle : $Page);
27 printf('<a href="%s">%s</a> →'."\n", $link, $linktitle);
34 function showthumb($path)
36 // assume all album entries are symlinks to archive originals
37 $target = preg_replace('{^(\.\./)*}', '', readlink($path));
38 $thumb = 'thumb/200/' . $target;
40 @list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3);
41 $imgtag = 'img src="/'.$thumb.'"';
43 $imgtag .= ' title="'.htmlspecialchars(urldecode($title)).'"';
46 $imgtag .= ' data-size="'.$size.'"';
49 return sprintf('<a href="/%s"><%s /></a>'."\n", $target, $imgtag);
52 if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
54 print '<ul class="gallery cat">'."\n";
55 foreach ($imgs as $path) {
56 $parts = pathinfo($path);
57 $album = $parts['filename'];
58 $cover = "$path/index.jpg";
59 if (!file_exists($cover)) $cover = 'foto/index.jpg';
60 if (is_link($cover)) {
61 $cover = preg_replace('{^(?:\.\./)*(?=data/)}', 'thumb/100/', readlink($cover));
64 $html = '<img src="/'.$cover.'" />';
65 $html .= "<figcaption>$album</figcaption>";
66 if (empty($User) and file_exists("$path/.private")) {
67 $html = '<strike title="bewoners">'.$html.'</strike>';
69 $html = "<figure>$html</figure>";
71 printf('<li id="%s"><a href="%s">%s</a>'."\n", $album, "/$path", $html);
76 if ($imgs = glob("$rootdir/*.jpg")) {
77 print '<ul class="gallery album">'."\n";
78 foreach ($imgs as $img) {
79 if ($img == "$rootdir/index.jpg") continue;
80 if (!is_link($img)) continue;
81 print '<li>'.showthumb($img);
85 include 'foto/album.inc.php';