X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/4867902ad83bc343db74316e54058d85627ec5f2..42039af9beb75f90f22fad213eafb0b5c39c71aa:/nieuws.inc.php diff --git a/nieuws.inc.php b/nieuws.inc.php index 3d88a26..8af5694 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -1,4 +1,5 @@ ', $url, $parts)) return; + if (!preg_match('', $url, $parts)) return; global $monthname; return implode(' ', array_filter([ intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1], @@ -29,10 +30,10 @@ function shownewsarticle($url, $link = TRUE, $title = NULL) return preg_replace('{

(.*?)

}', $title, $html); } -function shownews($root, $limit = 5) +function shownews($input, $limit = 1000) { - if (strpos($root, '/') === FALSE) $root .= '/*'; - foreach (array_reverse(glob("$root/*.html")) as $url) { + if (!is_array($input)) $input = glob("$input/*.html"); + foreach (array_reverse($input) as $url) { print "
"; ob_start(); include $url;