3 'januari', 'februari', 'maart', 'april', 'mei', 'juni',
4 'juli', 'augustus', 'september', 'oktober', 'november', 'december',
7 function shownewsdate($url)
9 $parts = pathinfo($url);
10 $year = pathinfo($parts['dirname'], PATHINFO_FILENAME);
11 @list ($month, $day) = explode('-', $parts['filename'], 3);
13 return sprintf('<small class="date">%s %s %s</small>',
14 intval($day), $monthname[intval($month)], $year);
17 function shownewsarticle($url, $link = TRUE, $title = NULL)
19 $html = ob_get_clean();
20 $date = shownewsdate($url);
26 $link ? '<h3><a href="/%2$s">%s</a></h3>' : '<h2>%s</h2>',
27 getoutput([1 => ' <small class="date">'.$date.'</small>']),
28 preg_replace('/\.html$/', '', $url)
30 return preg_replace('{<h2>(.*?)</h2>}', $title, $html);
33 function shownews($root, $limit = 5)
35 foreach (array_reverse(glob("$root/*/*.html")) as $url) {
39 print shownewsarticle($url);
40 print "</article>\n\n";
42 if (--$limit <= 0) break;