<?php
include 'nieuws.inc.php';
-if ($Args) {
+@list ($year, $month, $page) = explode('/', trim($Args, '/'));
+
+if ($page) {
$edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
print shownewsarticle($Args, FALSE, $edit);
- return;
+ return 1;
}
-ob_clean();
-print "<h2>Nieuwsarchief</h2>\n\n";
+if ($year) {
+ ob_clean();
+ print "<h2>Nieuws $year</h2>\n\n";
+
+ print '<div id="news">'."\n\n";
+ shownews("$Page/$year/??", 100);
+ print "</div>\n\n";
+
+ return 1;
+}
print '<div id="news">'."\n\n";
-shownews($Page, 20);
+
+foreach (array_reverse(glob("$Page/2???")) as $page) {
+ $year = basename($page, '.html');
+ printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
+ printtoc("$page/??");
+}
+
print "</div>\n\n";
if (!empty($User['admin'])) {