';
printf(
X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/1428caff970f73f026f1467c7741798ca7c9272c..90aa0008ae27ede1ed29799bcd22aca152b6a06f:/nieuws.inc.php?ds=sidebyside diff --git a/nieuws.inc.php b/nieuws.inc.php index 40313e4..40432a9 100644 --- a/nieuws.inc.php +++ b/nieuws.inc.php @@ -78,16 +78,27 @@ class ArchiveArticle { $this->title; $rest = fread($this->file, filesize($this->page)); - if ( preg_match('{\n
(]*>)
}', $rest, $img, PREG_OFFSET_CAPTURE) ) { - $this->img = $img[1][0]; + if ( preg_match('{ + \n (?: < (?: p | figure [^>]* ) >\s* )+ (]*>) | \n(.*?)
}s', $this->body, $bodyp)) { + return $bodyp[1]; + } + } + function img() { + $this->img = NULL; $this->body; return $this->img; } @@ -102,7 +113,10 @@ class ArchiveArticle function thumb($size = '300x') { if (!$this->image or $this->image[0] !== '/') return; - return preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image); + return preg_replace( + ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''], + $this->image + ); } } @@ -113,9 +127,11 @@ function shownews($input, $limit = 1000) $article = new ArchiveArticle($filename); print '