X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/229b6a2dc688e92570dd7f8b766adec3e1ee01ed..c4a26421caba8b697d9aa197bb2a5c55b7e2c5ff:/article.inc.php diff --git a/article.inc.php b/article.inc.php index 36639f2..9e92094 100644 --- a/article.inc.php +++ b/article.inc.php @@ -7,9 +7,9 @@ class ArchiveArticle function __construct($path) { - $this->page = preg_replace('{^\.(?:/|$)}', '', $path); - $this->link = preg_replace('{(?:(?:/|^)index)?\.html$}', '', $this->page); - $this->raw($this->page); + $this->file = preg_replace('{^\.(?:/|$)}', '', $path); + $this->link = preg_replace('{(?:(?:/|^)index)?\.html$}', '', $this->file); + $this->raw($this->file); } function raw($page) @@ -94,7 +94,7 @@ class ArchiveArticle function last() { - return filemtime($this->page); + return filemtime($this->file); } function lastiso() { @@ -103,7 +103,7 @@ class ArchiveArticle function dateparts() { - preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->page, $ymd); + preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->file, $ymd); array_shift($ymd); return $ymd; } @@ -165,8 +165,9 @@ class ArchiveArticle return ltrim($this->image, '/'); } return preg_replace( - ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''], - $this->image + ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/', '/(?:\.jpg)?$/'], + [ "thumb/$size", '', '.jpg' ], + $this->image, 1 ); }