2 $replyform = $Page == 'melding' && $User->login;
3 @list ($year, $page) = explode('/', trim($Args, '/'));
5 if ($User->admin("edit $Page")) {
6 print '<script src="/nieuws/edit.js"></script>'."\n";
9 if ($page and !is_numeric($page)) {
10 $Article->meta['og:type'] = 'article';
11 $edit = $User->admin("edit $Page$Args") ? htmlspecialchars(@$_GET['edit']) : NULL;
13 $Article->title = $edit;
15 if ($Article->dateparts) {
16 $Place[1] = ' <small class="date">'.$Article->date.'</small>';
18 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Article->raw);
19 if ($User->admin("edit $Page$Args")) {
21 foreach (glob("$Page/.tags/*") as $tagpath) {
22 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
23 $tagvalue = file_exists("$tagpath/$year-$page.html");
24 $tagtarget = is_writable($tagpath);
26 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
27 '<label for="%3$s"> %s</label>',
28 "tags[$tagname]", $tagname, "tag-$tagname",
29 $tagvalue ? ' checked' : '',
35 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
36 implode("\n\t", $taglist)
41 print placeholder_include('reply');
49 if (is_numeric($year) and $year > 999) {
51 if (is_numeric($page)) {
52 $title .= ' '.$monthname[intval($page)];
53 $match .= sprintf('%02d-', $page);
57 elseif ($year === '19') {
59 $title .= " vóór 2000";
61 elseif (file_exists("$Page/.tags/$year")) {
62 $match .= "/.tags/$year";
63 $title .= " met $year";
66 print "<h2>$title</h2>\n\n";
67 print placeholder_include('nieuws', [$match]);