X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/c3518f67a1134e20a497dbfc3161353b650e279d..234326791b1e8177eb475bffc5956d7086cfac4e:/nieuws.inc.php diff --git a/nieuws.inc.php b/nieuws.inc.php deleted file mode 100644 index c6f3be9..0000000 --- a/nieuws.inc.php +++ /dev/null @@ -1,122 +0,0 @@ - 0 ? $monthname[intval($parts[1])] : '', $parts[0], - count($parts) > 5 ? "$parts[3]:$parts[4]" : '', - ])); -} - -class ArchiveArticle -{ - function __construct($path) - { - $this->page = $path; - $this->link = preg_replace('{(?:/index)?\.html$}', '', $path); - } - - function __get($col) - { - return $this->$col = $this->$col(); # run method and cache - } - - function file() - { - if (!file_exists($this->page)) return; - return fopen($this->page, 'r'); - } - - function title() - { - return preg_replace('{
(.*?)
}s', $this->body, $bodyp)) { - return $bodyp[1]; - } - } - - function img() - { - $this->img = NULL; - $this->body; - return $this->img; - } - - function image() - { - if ( preg_match('/\bsrc="([^"]*)"/', $this->img, $src) ) { - return $src[1]; - } - } - - function thumb($size = '300x') - { - if (!$this->image or $this->image[0] !== '/') return; - return preg_replace( - ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''], - $this->image - ); - } -}