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 $article = new ArchiveArticle("$Page$Args.html");
10 $Place[1] = ' <small class="date">'.$article->date.'</small>';
11 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
12 if ($article->image) {
13 $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x');
17 print '<h3>Reacties</h3>'."\n";
18 $pagelink = $Page.$Args;
23 $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.txt';
24 $written = file_put_contents($target, $_POST['reply']);
25 if ($written === FALSE) {
26 throw new Exception('Fout bij opslaan');
28 $_POST['reply'] = NULL;
30 catch (Exception $e) {
31 print '<p class=warn>Antwoord niet opgeslagen.</p>'."\n\n";
35 print '<ul class="replies">';
37 foreach (glob("$pagelink/*.txt") as $reply) {
38 preg_match('</(\d{2,14}) : ([^:]*) [^/]* \.txt$>x', $reply, $replymeta);
39 if (!$replymeta) continue;
40 $replydate = str_split($replymeta[1], 2);
41 $replydate[1] = $replydate[0] . $replydate[1];
43 printf('<strong>%s</strong> <small class=date>%s</small>',
44 $replymeta[2], showdate($replydate)
46 $replydata = file_get_contents($reply);
47 printf('<p>%s</p>', nl2br(htmlspecialchars($replydata)));
52 print '<form method="post" action="">';
53 printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
55 "Bericht van {$User['name']}",
58 print '<input type="submit" value="Plaatsen" />'."\n";
59 print "</form></li>\n";
70 if (is_numeric($year) and $year > 999) {
71 $match = "$Page/$year/";
72 if (is_numeric($page)) {
73 $title .= ' '.$monthname[intval($page)];
74 $match .= sprintf('%02d-', $page);
78 elseif ($year === '19') {
79 $match = "$Page/19??/";
80 $title .= " vóór 2000";
83 print "<h2>$title</h2>\n\n";
84 shownews(glob($match.'*.html'));
88 print '<div id="news">'."\n\n";
90 foreach (array_reverse(glob("$Page/2???")) as $page) {
91 $year = basename($page, '.html');
92 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
96 if ($pages = glob("$Page/19??/*.html")) {
97 printf('<h3><a href="/%s">%s</a></h3>'."\n", "$Page/19", 'Eerder');
104 print "<h3>Melding rapporteren</h3>\n";
105 $_REQUEST['subject'] = 'melding';
106 require 'contact.php';
110 <textarea name="body" cols=60 rows=4></textarea>
111 <input type="submit" value="Versturen" />
117 if (!empty($User['admin'])) {
118 print '<script src="/nieuws/edit.js"></script>'."\n";