aboutsummaryrefslogtreecommitdiff
path: root/app/class
diff options
context:
space:
mode:
Diffstat (limited to 'app/class')
-rw-r--r--app/class/modelrender.php17
1 files changed, 17 insertions, 0 deletions
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 = '<img class="thumbnail" src="' . Model::thumbnailpath() . $this->art->id() . '.jpg" alt="' . $this->art->title() . '">';
+ $img = PHP_EOL . $img . PHP_EOL;
+ $text = str_replace('%THUMBNAIL%', $img, $text);
+
+ return $text;
+ }
+
public function taglink($text)
{
$rend = $this;