2 include 'nieuws.inc.php';
4 $replyform = $Page == 'melding' && !empty($User);
5 @list ($year, $page) = explode('/', trim($Args, '/'));
7 if ($page and !is_numeric($page)) {
8 $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
9 print shownewsarticle($Page.$Args, FALSE, $edit);
12 print '<h3>Reacties</h3>'."\n";
13 $pagelink = $Page.$Args;
18 $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.txt';
19 $written = file_put_contents($target, $_POST['reply']);
20 if ($written === FALSE) {
21 throw new Exception('Fout bij opslaan');
23 $_POST['reply'] = NULL;
25 catch (Exception $e) {
26 print '<p class=warn>Antwoord niet opgeslagen.</p>'."\n\n";
30 print '<ul class="replies">';
32 foreach (glob("$pagelink/*.txt") as $reply) {
33 preg_match('</(\d{14}) : ([^:]*) [^/]* \.txt$>x', $reply, $replymeta);
34 if (!$replymeta) continue;
35 $replydate = str_split($replymeta[1], 2);
36 $replydate[1] = $replydate[0] . $replydate[1];
38 printf('<strong>%s</strong> <small class=date>%s</small>',
39 $replymeta[2], showdate($replydate)
41 $replydata = file_get_contents($reply);
42 printf('<p>%s</p>', nl2br(htmlspecialchars($replydata)));
47 print '<form method="post" action="">';
48 printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
50 "Bericht van {$User['name']}",
53 print '<input type="submit" value="Plaatsen" />'."\n";
54 print "</form></li>\n";
65 if (is_numeric($year) and $year > 999) {
66 $match = "$Page/$year/";
67 if (is_numeric($page)) {
68 $title .= ' '.$monthname[intval($page)];
69 $match .= sprintf('%02d-', $page);
73 elseif ($year === '19') {
74 $match = "$Page/19??/";
75 $title .= " vóór 2000";
78 print "<h2>$title</h2>\n\n";
79 shownews(glob($match.'*.html'));
83 print '<div id="news">'."\n\n";
85 foreach (array_reverse(glob("$Page/2???")) as $page) {
86 $year = basename($page, '.html');
87 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
91 if ($pages = glob("$Page/19??/*.html")) {
92 printf('<h3><a href="/%s">%s</a></h3>'."\n", "$Page/19", 'Eerder');
99 print "<h3>Melding rapporteren</h3>\n";
100 $_REQUEST['subject'] = 'melding';
101 require 'contact.php';
105 <textarea name="body" cols=60 rows=4></textarea>
106 <input type="submit" value="Versturen" />
112 if (!empty($User['admin'])) {
113 print '<script src="/nieuws/edit.js"></script>'."\n";