2 $replyform = $Page->handler == 'melding' && $User->login;
3 @list ($year, $page) = explode('/', trim($Page->path, '/'));
5 if ($User->admin("edit {$Page->handler}")) {
6 $Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;
9 if ($page and !is_numeric($page)) {
10 $Page->meta['og:type'] = 'article';
11 $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL;
15 if ($Page->dateparts) {
16 $Page->place[1] = ' <small class="date">'.$Page->date.'</small>';
21 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Page->raw);
22 if ($User->admin("edit {$Page->link}")) {
24 foreach (glob("{$Page->handler}/.tags/*") as $tagpath) {
25 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
26 $tagvalue = file_exists("$tagpath/$year-$page.html");
27 $tagtarget = is_writable($tagpath);
29 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
30 '<label for="%3$s"> %s</label>',
31 "tags[$tagname]", $tagname, "tag-$tagname",
32 $tagvalue ? ' checked' : '',
38 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
39 implode("\n\t", $taglist)
44 print $Page->widget('reply');
50 $match = $Page->handler;
52 if (is_numeric($year) and $year > 999) {
54 if (is_numeric($page)) {
55 $title .= ' '.$monthname[intval($page)];
56 $match .= sprintf('%02d-', $page);
60 elseif ($year === '19') {
62 $title .= " vóór 2000";
64 elseif (file_exists("{$Page->handler}/.tags/$year")) {
65 $match .= "/.tags/$year";
66 $title .= " met $year";
69 print "<h2>$title</h2>\n\n";
70 print $Page->widget('nieuws', [$match]);