2 $replyform = $Page->handler == 'melding' && $User->login;
3 @list ($year, $page) = explode('/', trim($Page->path, '/'));
7 if ($User->admin("edit {$Page->handler}")) {
8 $Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;
11 if ($page and !is_numeric($page)) {
12 $Page->meta['og:type'] = 'article';
13 $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL;
17 if ($Page->dateparts) {
18 $Page->place[1] = ' <small class="date">'.showdate($Page->dateparts).'</small>';
23 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Page->raw);
24 if ($User->admin("edit {$Page->link}")) {
26 foreach (glob("{$Page->handler}/.tags/*") as $tagpath) {
27 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
28 $tagvalue = file_exists("$tagpath/$year-$page.html");
29 $tagtarget = is_writable($tagpath);
31 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
32 '<label for="%3$s"> %s</label>',
33 "tags[$tagname]", $tagname, "tag-$tagname",
34 $tagvalue ? ' checked' : '',
40 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
41 implode("\n\t", $taglist)
46 print $Page->widget('reply');
52 $match = $Page->handler;
54 if (is_numeric($year) and $year > 999) {
56 if (is_numeric($page)) {
57 $title .= ' '.$monthname[intval($page)];
58 $match .= sprintf('%02d-', $page);
62 elseif ($year === '19') {
64 $title .= " vóór 2000";
66 elseif (file_exists("{$Page->handler}/.tags/$year")) {
67 $match .= "/.tags/$year";
68 $title .= " met $year";
71 print "<h2>$title</h2>\n\n";
72 print $Page->widget('nieuws', [$match]);