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 return filemtime($this->page);
52 return date(DATE_ATOM, $this->last);
57 preg_match('</(\d{4})/(\d{2})-(\d{2})->', $this->page, $ymd);
63 return implode('-', $this->dateparts());
68 return showdate($this->dateparts);
73 return fread($this->file, filesize($this->page));
78 foreach (['jpg', 'png'] as $ext) {
79 if (file_exists("{$this->link}.$ext")) {
80 return "{$this->link}.$ext";
85 function thumb($size = '300x')
88 return "thumb/$size/{$this->image}";
92 function shownews($input, $limit = 1000)
94 if (!is_array($input)) $input = glob("$input/*.html");
95 print '<ul class="left">'."\n\n";
96 foreach (array_reverse($input) as $filename) {
97 $article = new ArchiveArticle($filename);
99 if ($article->thumb) {
100 printf('<img src="/%s" class="left" />', $article->thumb);
104 '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
105 $article->link, $article->title, $article->date
107 print $article->body;
108 print "</article></li>\n\n";
110 if (--$limit <= 0) break;
115 function printtoc($input)
117 if (!is_array($input)) $input = glob("$input/*.html");
119 foreach (array_reverse($input) as $page) {
120 $article = new ArchiveArticle($page);
121 printf('<li><a href="/%s">%s <small class="date">%s</small></a></li>',
122 $article->link, $article->safetitle, $article->date);