nieuws: hide text after cover image in overviews
[minimedit.git] / nieuws.php
index cafc94c6795a25ec866ee06c04fa689000c64e42..2b0151da20f0de37f327e68c1d6af6503dd74ceb 100644 (file)
@@ -1,4 +1,22 @@
 <?php
 include_once 'nieuws.inc.php';
-$articles = ($Page ?: 'nieuws') . '/????';
-shownews($articles, @$_GET['n'] ?: 5);
+$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();