From 6e9950106bf69ac3e7bf7b8244ba3bcfec7572d9 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sun, 31 Mar 2019 19:55:32 +0200 Subject: fix extension in thumbnail render --- app/class/modelrender.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app') diff --git a/app/class/modelrender.php b/app/class/modelrender.php index 2b22bb1..8957559 100644 --- a/app/class/modelrender.php +++ b/app/class/modelrender.php @@ -141,6 +141,7 @@ class Modelrender extends Modelart $content = $this->automedialist($content); $content = $this->autotaglistupdate($content); $content = $this->date($content); + $content = $this->thumbnail($content); if($element->autolink()) { $content = str_replace('%LINK%', '' ,$content); $content = $this->everylink($content, $element->autolink()); @@ -527,6 +528,22 @@ class Modelrender extends Modelart return $text; } + /** + * Render thumbnail of the page + * + * @param string $text Text to analyse + * + * @return string The rendered output + */ + public function thumbnail(string $text) : string + { + $img = '' . $this->art->title() . ''; + $img = PHP_EOL . $img . PHP_EOL; + $text = str_replace('%THUMBNAIL%', $img, $text); + + return $text; + } + public function taglink($text) { $rend = $this; -- cgit v1.2.3