2 $intro = ob_get_clean();
4 $rootdir = 'foto' . $Args;
6 if (!empty($User['admin'])) {
7 $access = '🔓 Openbaar';
8 if (isset($PageAccess)) {
9 $access = "🔒 Bewoners";
10 if ($PageAccess != $Page.$Args) {
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('/', $Page.$Args);
20 $title = array_pop($nav);
21 $rootname = "Foto's"; # override of 'foto'
24 foreach ($nav as $i => $linktitle) {
25 $link .= "/$linktitle";
26 printf('<a href="%s">%s</a> →'."\n", $link, $i ? $linktitle : $rootname);
28 print $Args ? $title : $rootname;
33 function showthumb($path)
35 // assume all album entries are symlinks to archive originals
36 $target = preg_replace('{^(\.\./)*}', '', readlink($path));
37 $thumb = 'thumb/200/' . $target;
39 @list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3);
40 $imgtag = 'img src="/'.$thumb.'"';
42 $imgtag .= ' title="'.htmlspecialchars(urldecode($title)).'"';
45 $imgtag .= ' data-size="'.$size.'"';
48 return sprintf('<a href="/%s"><%s /></a>'."\n", $target, $imgtag);
51 if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
53 print '<ul class="gallery cat">'."\n";
54 foreach ($imgs as $path) {
55 $parts = pathinfo($path);
56 $album = $parts['filename'];
57 $cover = "$path/index.jpg";
58 if (!file_exists($cover)) $cover = 'foto/index.jpg';
59 if (is_link($cover)) {
60 $cover = preg_replace('{^(?:\.\./)*(?=data/)}', 'thumb/100/', readlink($cover));
63 $html = '<img src="/'.$cover.'" />';
64 $html .= "<figcaption>$album</figcaption>";
65 if (empty($User) and file_exists("$path/.private")) {
66 $html = '<strike title="bewoners">'.$html.'</strike>';
68 $html = "<figure>$html</figure>";
70 printf('<li id="%s"><a href="%s">%s</a>'."\n", $album, "/$path", $html);
75 if ($imgs = glob("$rootdir/*.jpg")) {
76 print '<ul class="gallery album">'."\n";
77 foreach ($imgs as $img) {
78 if ($img == "$rootdir/index.jpg") continue;
79 if (!is_link($img)) continue;
80 print '<li>'.showthumb($img);
84 include 'foto/album.inc.php';