4 'januari', 'februari', 'maart', 'april', 'mei', 'juni',
5 'juli', 'augustus', 'september', 'oktober', 'november', 'december',
8 function shownewsdate($url)
10 if (!preg_match('</(\d{4})/(\d{2})-(\d{2})->', $url, $parts)) return;
12 return implode(' ', array_filter([
13 intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1],
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($input, $limit = 1000)
35 if (!is_array($input)) $input = glob("$input/*.html");
36 foreach (array_reverse($input) as $url) {
40 print shownewsarticle($url);
41 print "</article>\n\n";
43 if (--$limit <= 0) break;
47 function printtoc($input)
49 if (!is_array($input)) $input = glob("$input/*.html");
51 foreach (array_reverse($input) as $page) {
52 $title = fgets(fopen($page, 'r'));
53 $title = strip_tags($title);
54 $linkurl = preg_replace('/\.html$/', '', $page);
55 printf('<li><a href="/%s">%s <small class="date">%s</small></a></li>',
56 $linkurl, $title, shownewsdate($linkurl));