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'] = $article->title;
15 $Place[1] = ' <small class="date">'.$article->date.'</small>';
16 print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
17 if ($article->file and $article->image) {
18 $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x');
20 if (!empty($User['admin'])) {
22 foreach (glob("$Page/.tags/*") as $tagpath) {
23 $tagname = pathinfo($tagpath, PATHINFO_BASENAME);
24 $tagvalue = file_exists("$tagpath/$year-$page.html");
25 $tagtarget = is_writable($tagpath);
27 '<input type="checkbox" name="%s" value="%s" id="%s"%s%s />' .
28 '<label for="%3$s"> %s</label>',
29 "tags[$tagname]", $tagname, "tag-$tagname",
30 $tagvalue ? ' checked' : '',
36 printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
37 implode("\n\t", $taglist)
42 print placeholder_include('nieuws/replies');
51 if (is_numeric($year) and $year > 999) {
53 if (is_numeric($page)) {
54 $title .= ' '.$monthname[intval($page)];
55 $match .= sprintf('%02d-', $page);
59 elseif ($year === '19') {
61 $title .= " vóór 2000";
63 elseif (file_exists("$Page/.tags/$year")) {
64 $match .= "/.tags/$year";
65 $title .= " met $year";
68 print "<h2>$title</h2>\n\n";
69 print placeholder_include('nieuws', [$match]);