X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/a332183ffe74a1580779a5eeeeb7dbe02a398075..eccaf81eef4c1528875503aa0cdbea130d755c5a:/nieuws.inc.php diff --git a/nieuws.inc.php b/nieuws.inc.php index 454c91c..524109d 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -5,15 +5,21 @@ $monthname = ['?', 'juli', 'augustus', 'september', 'oktober', 'november', 'december', ]; -function shownewsdate($url) +function showdate($parts) { - if (!preg_match('', $url, $parts)) return; global $monthname; return implode(' ', array_filter([ intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1], + count($parts) > 6 ? "$parts[4]:$parts[5]" : '', ])); } +function shownewsdate($url) +{ + if (!preg_match('', $url, $parts)) return; + return showdate($parts); +} + function shownewsimage($url) { foreach (['jpg', 'png'] as $ext) { @@ -53,15 +59,22 @@ function shownewsarticle($url, $link = TRUE, $title = NULL) function shownews($input, $limit = 1000) { if (!is_array($input)) $input = glob("$input/*.html"); - foreach (array_reverse($input) as $url) { - print "
"; + print '
\n\n"; if (--$limit <= 0) break; } + print "\n\n"; } function printtoc($input)