nieuws: placeholder script to show articles
[minimedit.git] / nieuws.inc.php
index 25952ef189a35f7a076d7385caf9789262ea02e3..f4d42d8d82223a9b3898ca8a91abb6622e5ba390 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+global $monthname;
 $monthname = ['?',
        'januari', 'februari', 'maart', 'april', 'mei', 'juni',
        'juli', 'augustus', 'september', 'oktober', 'november', 'december',
@@ -29,7 +30,7 @@ function shownewsarticle($url, $link = TRUE, $title = NULL)
        return preg_replace('{<h2>(.*?)</h2>}', $title, $html);
 }
 
-function shownews($root, $limit = 5)
+function shownews($root, $limit = 1000)
 {
        if (strpos($root, '/') === FALSE) $root .= '/*';
        foreach (array_reverse(glob("$root/*.html")) as $url) {
@@ -43,10 +44,11 @@ function shownews($root, $limit = 5)
        }
 }
 
-function printtoc($root)
+function printtoc($input)
 {
+       if (!is_array($input)) $input = glob("$input/*.html");
        print '<ul>';
-       foreach (array_reverse(glob("$root/*.html")) as $page) {
+       foreach (array_reverse($input) as $page) {
                $title = fgets(fopen($page, 'r'));
                $title = strip_tags($title);
                $linkurl = preg_replace('/\.html$/', '', $page);