nieuws: article index on sitemap request
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 12 Dec 2020 14:16:29 +0000 (15:16 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 19 Dec 2020 02:01:43 +0000 (03:01 +0100)
Restore subpages ignored since previous commit.

foto/index.php
nieuws/index.php

index c2cc95c730a37361bc82143085340dc8593df233..1e973c786c14855a2c56b998de5db72f4b9359b0 100644 (file)
@@ -12,6 +12,9 @@ if (!$User) {
                # cover image of current album
                $Page->image = "/$img";
        }
+       if (!$Page->path) {
+               return glob("$rootdir/*", GLOB_ONLYDIR); #TODO: recurse
+       }
        return;
 }
 
index 59b24a426674afe04d1292e18647fb89f22952a4..507f493d32f4c5659fdcfcbd3c495f92ca38ca22 100644 (file)
@@ -2,7 +2,10 @@
 $replyform = $Page->handler == 'melding' && $User->login;
 @list ($year, $page) = explode('/', trim($Page->path, '/'));
 
-if (!$User) return;
+if (!$User) {
+       if ($Page->path) return;
+       return array_keys((new PageSearch($Page->link))->files());
+}
 
 if ($User->admin("edit {$Page->handler}")) {
        $Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;