<?php
-include 'nieuws.inc.php';
-
-if ($Args) {
- $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
- print shownewsarticle($Args, FALSE, $edit);
- return;
+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 .= '/????';
}
-ob_clean();
-print "<h2>Nieuwsarchief</h2>\n\n";
-
-print '<div id="news">'."\n\n";
-shownews($Page, 20);
-print "</div>\n\n";
-
-if (!empty($User['admin'])) {
- print '<script src="/nieuws/edit.js"></script>'."\n";
+if (@$Place['view'] === 'toc') {
+ printtoc($articles);
+ return;
}
+ob_start();
+shownews($articles, @$Place['n'] ?: 5);
+print getoutput();