nieuws: port excelsior toc and year filtering
[minimedit.git] / nieuws.php
1 <?php
2 include 'nieuws.inc.php';
3
4 @list ($year, $month, $page) = explode('/', trim($Args, '/'));
5
6 if ($page) {
7         $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
8         print shownewsarticle($Args, FALSE, $edit);
9         return 1;
10 }
11
12 if ($year) {
13         ob_clean();
14         print "<h2>Nieuws $year</h2>\n\n";
15
16         print '<div id="news">'."\n\n";
17         shownews("$Page/$year/??", 100);
18         print "</div>\n\n";
19
20         return 1;
21 }
22
23 print '<div id="news">'."\n\n";
24
25 foreach (array_reverse(glob("$Page/2???")) as $page) {
26         $year = basename($page, '.html');
27         printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
28         printtoc("$page/??");
29 }
30
31 print "</div>\n\n";
32
33 if (!empty($User['admin'])) {
34         print '<script src="/nieuws/edit.js"></script>'."\n";
35 }