2 $rootdir = $Page->link;
4 if ($User->admin('foto')) {
5 if ($Page->restricted) {
6 $access = '<span class="icon icon-locked">🔒</span> Bewoners';
7 if ($Page->restricted != $rootdir) {
8 $access .= sprintf(' vanaf <a href="%s">%s</a>',
9 "/{$Page->restricted}", pathinfo($Page->restricted, PATHINFO_FILENAME)
14 $access = '<span class="icon icon-locked">🔓</span> Openbaar';
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);
22 $Page->title = ($nav ? implode(' ', $nav) . ': ' : '') . $title;
26 foreach ($nav as $i => $linktitle) {
27 $link .= '/' . ($i ? $linktitle : $Page->handler);
28 printf('<a href="%s">%s</a> →'."\n", $link, $linktitle);
33 if (isset($Page->raw)) {
34 print $Page->raw; # page intro
37 function showthumb($path)
39 // assume all album entries are symlinks to archive originals
40 $target = preg_replace('{^(\.\./)*}', '', readlink($path));
41 $thumb = 'thumb/262/' . $target;
43 @list ($order, $size, $title) = explode(':', pathinfo($path, PATHINFO_FILENAME), 3);
44 $imgtag = 'img src="/'.$thumb.'"';
46 $imgtag .= ' title="'.htmlspecialchars(urldecode($title)).'"';
49 $imgtag .= ' data-size="'.$size.'"';
52 return sprintf('<a href="/%s"><%s /></a>'."\n", $target, $imgtag);
55 if ($imgs = glob("$rootdir/*", GLOB_ONLYDIR)) {
57 print '<ul class="gallery cat">'."\n";
58 foreach ($imgs as $path) {
59 $parts = pathinfo($path);
60 $album = $parts['filename'];
61 $cover = "$path/index.jpg";
62 if (!file_exists($cover)) $cover = 'foto/index.jpg';
63 if (is_link($cover)) {
64 $cover = preg_replace('{^(?:\.\./)*(?=data/)}', 'thumb/100/', readlink($cover));
67 $html = '<img src="/'.$cover.'" />';
68 $html .= "<figcaption>$album</figcaption>";
69 if (!$User->login and file_exists("$path/.private")) {
70 $html = '<s title="bewoners">'.$html.'</s>';
72 $html = "<figure>$html</figure>";
74 printf('<li id="%s"><a href="%s">%s</a>'."\n", $album, "/$path", $html);
79 if ($imgs = glob("$rootdir/*.jpg")) {
80 print '<ul class="gallery album">'."\n";
81 foreach ($imgs as $img) {
82 if ($img == "$rootdir/index.jpg") {
83 # cover image of current album
84 $Page->image = "/$img";
87 if (!is_link($img)) continue;
88 print '<li>'.showthumb($img);
92 include 'foto/album.inc.php';