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>';
21 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Article->raw);
22 if ($User->admin("edit $Page$Args")) {
24 foreach (glob("$Page/.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 placeholder_include('reply');
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/.tags/$year")) {
65 $match .= "/.tags/$year";
66 $title .= " met $year";
69 print "<h2>$title</h2>\n\n";
70 print placeholder_include('nieuws', [$match]);