2 $replyform = $Page == 'melding' && !empty($User);
3 @list ($year, $page) = explode('/', trim($Args, '/'));
5 if ($User and $User->admin('news')) {
6 print '<script src="/nieuws/edit.js"></script>'."\n";
9 if ($page and !is_numeric($page)) {
10 $edit = $User && $User->admin('news') ? htmlspecialchars(@$_GET['edit']) : NULL;
12 $Article->title = $edit;
14 if ($Article->dateparts) {
15 $Place[1] = ' <small class="date">'.$Article->date.'</small>';
17 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $Article->raw);
18 if ($User and $User->admin('news')) {
20 foreach (glob("$Page/.tags/*") as $tagpath) {
21 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
22 $tagvalue = file_exists("$tagpath/$year-$page.html");
23 $tagtarget = is_writable($tagpath);
25 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
26 '<label for="%3$s"> %s</label>',
27 "tags[$tagname]", $tagname, "tag-$tagname",
28 $tagvalue ? ' checked' : '',
34 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
35 implode("\n\t", $taglist)
40 print placeholder_include('reply');
48 if (is_numeric($year) and $year > 999) {
50 if (is_numeric($page)) {
51 $title .= ' '.$monthname[intval($page)];
52 $match .= sprintf('%02d-', $page);
56 elseif ($year === '19') {
58 $title .= " vóór 2000";
60 elseif (file_exists("$Page/.tags/$year")) {
61 $match .= "/.tags/$year";
62 $title .= " met $year";
65 print "<h2>$title</h2>\n\n";
66 print placeholder_include('nieuws', [$match]);