nieuws: call placeholder for year lists
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 3 Sep 2018 20:25:22 +0000 (22:25 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 3 Sep 2018 21:24:18 +0000 (23:24 +0200)
nieuws.php
nieuws/index.php

index fda142e62c50985599785298f8d1bb1be22077ae..7127a545332171b144ebdb457396e5c1e38a5330 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 include_once 'nieuws.inc.php';
-$articles = (ltrim($Args, '/') ?: 'nieuws') . '/????';
+$articles = (ltrim($Args, '/') ?: 'nieuws');
+if (strpos($articles, '/') === FALSE) {
+       $articles .= '/????';
+}
 ob_start();
 shownews($articles, @$Place['n'] ?: 5);
 print getoutput();
index 4da5a8bc9c22895cc66ddf0906fb6228875d82bd..468de280f72cfd6a6cb480269256fa9f59621901 100644 (file)
@@ -20,9 +20,10 @@ if ($page and !is_numeric($page)) {
 
 if ($year) {
        ob_clean();
+       $match = $Page;
        $title = "Nieuws";
        if (is_numeric($year) and $year > 999) {
-               $match = "$Page/$year/";
+               $match .= "/$year";
                if (is_numeric($page)) {
                        $title .= ' '.$monthname[intval($page)];
                        $match .= sprintf('%02d-', $page);
@@ -30,12 +31,12 @@ if ($year) {
                $title .= ' '.$year;
        }
        elseif ($year === '19') {
-               $match = "$Page/19??/";
+               $match .= "/19??";
                $title .= " vóór 2000";
        }
 
        print "<h2>$title</h2>\n\n";
-       shownews(glob($match.'*.html'));
+       print placeholder_include('nieuws', [$match]);
        return 1;
 }