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');
14 printf('<p><img src="/%s" /></p>'."\n", $article->thumb('640x'));
18 print '<h3>Reacties</h3>'."\n";
19 $pagelink = $Page.$Args;
24 $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.txt';
25 $written = file_put_contents($target, $_POST['reply']);
26 if ($written === FALSE) {
27 throw new Exception('Fout bij opslaan');
29 $_POST['reply'] = NULL;
31 catch (Exception $e) {
32 print '<p class=warn>Antwoord niet opgeslagen.</p>'."\n\n";
36 print '<ul class="replies">';
38 foreach (glob("$pagelink/*.txt") as $reply) {
39 preg_match('</(\d{2,14}) : ([^:]*) [^/]* \.txt$>x', $reply, $replymeta);
40 if (!$replymeta) continue;
41 $replydate = str_split($replymeta[1], 2);
42 $replydate[1] = $replydate[0] . $replydate[1];
44 printf('<strong>%s</strong> <small class=date>%s</small>',
45 $replymeta[2], showdate($replydate)
47 $replydata = file_get_contents($reply);
48 printf('<p>%s</p>', nl2br(htmlspecialchars($replydata)));
53 print '<form method="post" action="">';
54 printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
56 "Bericht van {$User['name']}",
59 print '<input type="submit" value="Plaatsen" />'."\n";
60 print "</form></li>\n";
71 if (is_numeric($year) and $year > 999) {
72 $match = "$Page/$year/";
73 if (is_numeric($page)) {
74 $title .= ' '.$monthname[intval($page)];
75 $match .= sprintf('%02d-', $page);
79 elseif ($year === '19') {
80 $match = "$Page/19??/";
81 $title .= " vóór 2000";
84 print "<h2>$title</h2>\n\n";
85 shownews(glob($match.'*.html'));
89 print '<div id="news">'."\n\n";
91 foreach (array_reverse(glob("$Page/2???")) as $page) {
92 $year = basename($page, '.html');
93 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
97 if ($pages = glob("$Page/19??/*.html")) {
98 printf('<h3><a href="/%s">%s</a></h3>'."\n", "$Page/19", 'Eerder');
105 print "<h3>Melding rapporteren</h3>\n";
106 $_REQUEST['subject'] = 'melding';
107 require 'contact.php';
111 <textarea name="body" cols=60 rows=4></textarea>
112 <input type="submit" value="Versturen" />
118 if (!empty($User['admin'])) {
119 print '<script src="/nieuws/edit.js"></script>'."\n";