nieuws: support tagged article links
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 3 Sep 2018 21:21:27 +0000 (23:21 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 3 Sep 2018 21:24:19 +0000 (23:24 +0200)
nieuws.inc.php
nieuws/index.php

index 79f718d4b6585ba0296a7b4cfb1f3581ccab581b..930eb00a2c96a8b4cb415472a462d7fe20148702 100644 (file)
@@ -54,7 +54,7 @@ class ArchiveArticle
 
        function dateparts()
        {
-               preg_match('</(\d{4})/(\d{2})-(\d{2})->', $this->page, $ymd);
+               preg_match('</(\d{4})[/-](\d{2})-(\d{2})->', $this->page, $ymd);
                return $ymd;
        }
 
index b54d5bd7a38a04e5fa0f7b8891d9a618266c5191..11e305ef04a98fe7323306bf4640adcf9b08e8ba 100644 (file)
@@ -34,6 +34,10 @@ if ($year) {
                $match .= "/19??";
                $title .= " vóór 2000";
        }
+       elseif (file_exists("$Page/.tags/$year")) {
+               $match .= "/.tags/$year";
+               $title .= " met $year";
+       }
 
        print "<h2>$title</h2>\n\n";
        print placeholder_include('nieuws', [$match]);