2 $replyform = $Page->handler == 'melding' && $User->login;
3 @list ($year, $page) = explode('/', trim($Page->path, '/'));
6 if ($Page->path) return;
7 return (new PageSearch($Page->link))->files();
10 if ($User->admin("edit {$Page->handler}")) {
11 $Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;
14 if ($page and !is_numeric($page)) {
15 $Page->meta['og:type'] = 'article';
16 $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL;
20 if ($Page->dateparts) {
21 $Page->place[1] = ' <small class="date">'.showdate($Page->dateparts).'</small>';
26 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Page->raw);
27 if ($User->admin("edit {$Page->link}")) {
29 foreach (glob("{$Page->handler}/.tags/*") as $tagpath) {
30 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
31 $tagvalue = file_exists("$tagpath/$year-$page.html");
32 $tagtarget = is_writable($tagpath);
34 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
35 '<label for="%3$s"> %s</label>',
36 "tags[$tagname]", $tagname, "tag-$tagname",
37 $tagvalue ? ' checked' : '',
43 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
44 implode("\n\t", $taglist)
49 print $Page->widget('reply');
55 $match = $Page->handler;
57 if (is_numeric($year) and $year > 999) {
59 if (is_numeric($page)) {
60 $title .= ' '.$monthname[intval($page)];
61 $match .= sprintf('%02d-', $page);
65 elseif ($year === '19') {
67 $title .= " vóór 2000";
69 elseif (file_exists("{$Page->handler}/.tags/$year")) {
70 $match .= "/.tags/$year";
71 $title .= " met $year";
74 print "<h2>$title</h2>\n\n";
75 print $Page->widget('nieuws', [$match]);