2 include 'nieuws.inc.php';
4 $replyform = $Page == 'melding' && !empty($User);
5 @list ($year, $page) = explode('/', trim($Args, '/'));
7 if (!empty($User['admin'])) {
8 print '<script src="/nieuws/edit.js"></script>'."\n";
11 if ($page and !is_numeric($page)) {
12 $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
13 $article = new ArchiveArticle("$Page$Args.html");
14 $Place['title'] = $edit ?: $article->title;
15 $Place['description'] = $article->teaser;
16 $Place[1] = ' <small class="date">'.$article->date.'</small>';
17 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
18 if ($article->file and $article->image) {
19 $Place['image'] = "/".$article->thumb('600x');
21 if (!empty($User['admin'])) {
23 foreach (glob("$Page/.tags/*") as $tagpath) {
24 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
25 $tagvalue = file_exists("$tagpath/$year-$page.html");
26 $tagtarget = is_writable($tagpath);
28 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
29 '<label for="%3$s"> %s</label>',
30 "tags[$tagname]", $tagname, "tag-$tagname",
31 $tagvalue ? ' checked' : '',
37 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
38 implode("\n\t", $taglist)
43 print placeholder_include('nieuws/replies');
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]);