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[2]), $parts[1] > 0 ? $monthname[intval($parts[1])] : '', $parts[0],
13 count($parts) > 5 ? "$parts[3]:$parts[4]" : '',
19 public $raw, $preface, $title, $body;
21 function __construct($path)
24 $this->link = preg_replace('{(?:/index)?\.html$}', '', $path);
25 if (file_exists($this->page)) {
26 $this->raw = file_get_contents($this->page);
27 @list ($this->preface, $this->title, $this->body) =
28 preg_split('{<h2>(.*?)</h2>\s*}', $this->raw, 2, PREG_SPLIT_DELIM_CAPTURE);
34 return $this->$col = $this->$col(); # run method and cache
39 return trim(strip_tags($this->title));
43 return $this->safetitle ?: $this->link;
48 return filemtime($this->page);
52 return date(DATE_ATOM, $this->last);
57 preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->page, $ymd);
63 return implode('-', $this->dateparts()) . 'T12:00:00+02:00';
67 return showdate($this->dateparts);
73 \n (?: < (?: p | figure [^>]* ) >\s* )+ (<img\ [^>]*>) | \n <hr\ />
74 }x', $this->body, $img, PREG_OFFSET_CAPTURE) ) {
75 # strip part after matching divider (image)
77 $this->img = $img[1][0];
79 return substr($this->body, 0, $img[0][1]);
85 if (preg_match('{<p>(.*?)</p>}s', $this->story, $bodyp)) {
98 if ( preg_match('/\bsrc="([^"]*)"/', $this->img, $src) ) {
102 function thumb($size = '300x')
104 if (!$this->image or $this->image[0] !== '/') return;
106 ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''],