4 'januari', 'februari', 'maart', 'april', 'mei', 'juni',
5 'juli', 'augustus', 'september', 'oktober', 'november', 'december',
8 function showdate($parts)
11 return implode(' ', array_filter([
12 intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1],
13 count($parts) > 6 ? "$parts[4]:$parts[5]" : '',
19 function __construct($path)
22 $this->link = preg_replace('/\.html$/', '', $path);
27 return $this->$col = $this->$col(); # run method and cache
32 return fopen($this->page, 'r');
37 return preg_replace('{<h2>(.*)</h2>\s*}', '\1', fgets($this->file));
42 return strip_tags($this->title);
47 if (!preg_match('</(\d{4})/(\d{2})-(\d{2})->', $this->page, $parts)) return;
48 return showdate($parts);
53 return fread($this->file, filesize($this->page));
58 foreach (['jpg', 'png'] as $ext) {
59 if (file_exists("{$this->link}.$ext")) {
60 return "{$this->link}.$ext";
65 function thumb($size = '300x')
68 return "thumb/$size/{$this->image}";
72 function shownews($input, $limit = 1000)
74 if (!is_array($input)) $input = glob("$input/*.html");
75 print '<ul class="left">'."\n\n";
76 foreach (array_reverse($input) as $filename) {
77 $article = new ArchiveArticle($filename);
79 if ($article->thumb) {
80 printf('<img src="/%s" class="left" />', $article->thumb);
84 '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
85 $article->link, $article->title, $article->date
88 print "</article></li>\n\n";
90 if (--$limit <= 0) break;
95 function printtoc($input)
97 if (!is_array($input)) $input = glob("$input/*.html");
99 foreach (array_reverse($input) as $page) {
100 $article = new ArchiveArticle($page);
101 printf('<li><a href="/%s">%s <small class="date">%s</small></a></li>',
102 $article->link, $article->safetitle, $article->date);