nieuws: toc view option to show headlines in placeholder
[minimedit.git] / nieuws.php
index 7127a545332171b144ebdb457396e5c1e38a5330..2b0151da20f0de37f327e68c1d6af6503dd74ceb 100644 (file)
@@ -2,8 +2,21 @@
 include_once 'nieuws.inc.php';
 $articles = (ltrim($Args, '/') ?: 'nieuws');
 if (strpos($articles, '/') === FALSE) {
+       if (@$Place['view'] === 'toc') {
+               foreach (array_reverse(glob("$articles/2???")) as $page) {
+                       $year = basename($page, '.html');
+                       printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
+                       printtoc($page);
+               }
+               return;
+       }
        $articles .= '/????';
 }
+
+if (@$Place['view'] === 'toc') {
+       printtoc($articles);
+       return;
+}
 ob_start();
 shownews($articles, @$Place['n'] ?: 5);
 print getoutput();