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();
--- /dev/null
+<div class="nav right"><a href="/nieuws/feed" rel="alternate" title="Atom feed van nieuwsberichten" type="application/atom+xml">Feed</a></div>
+
+<div id="news">
+<h2>Nieuwsarchief</h2>
+[[nieuws view=toc]]
+
+<h3><a href="/nieuws/19">Eerder</a></h3>
+[[nieuws view=toc nieuws/19??]]
+
+<h3>Melding rapporteren</h3>
+[[contact subject=melding]]
+
+<form method="post">
+<p><textarea cols="60" name="body" rows="4"></textarea> <input type="submit" value="Versturen" /></p>
+</form>
+</div>
return 1;
}
-$html = ob_get_clean();
-printf('<div class="nav right"><a href="%s"%s>Feed</a></div>'."\n",
- "/$Page/feed",
- ' rel="alternate" title="Atom feed van nieuwsberichten" type="application/atom+xml"'
-);
-print $html;
-
-print '<div id="news">'."\n\n";
-
-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);
-}
-
-if ($pages = glob("$Page/19??/*.html")) {
- printf('<h3><a href="/%s">%s</a></h3>'."\n", "$Page/19", 'Eerder');
- printtoc($pages);
-}
-
-print "</div>\n\n";
-
-if ($replyform) {
- print "<h3>Melding rapporteren</h3>\n";
- $_REQUEST['subject'] = 'melding';
- require 'contact.php';
-?>
-<form method="post">
-<p>
- <textarea name="body" cols=60 rows=4></textarea>
- <input type="submit" value="Versturen" />
-</p>
-</form>
-<?php
-}
-
if (!empty($User['admin'])) {
print '<script src="/nieuws/edit.js"></script>'."\n";
}