nieuws: indicate abbreviated teaser contents
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 27 Apr 2021 14:41:44 +0000 (16:41 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 27 Apr 2021 14:44:40 +0000 (16:44 +0200)
In story text is not identical, advertise where to find more details.
Assumes an external non-interactive display for now.

widget/nieuws.php

index 49f0453f39d2a835c9e81eded2bad5c2b50f7d8c..10e31a3c97b9f8fff0cab5469609035b85aedc2c 100644 (file)
@@ -19,7 +19,16 @@ function shownews($input, $limit = 1000, $abbr = FALSE)
                        '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
                        $article->link, $article->title, showdate($article->dateparts)
                );
-               print $abbr ? "<p>{$article->teaser}</p>\n" : $article->story;
+               if ($abbr) {
+                       print '<p>' . $article->teaser;
+                       if ($article->story != "<p>{$article->teaser}</p>\n\n") {
+                               print ' <small class="footer">(Meer op de site)</small>';
+                       }
+                       print "</p>\n";
+               }
+               else {
+                       print $article->story;
+               }
                print '</div>';
                print "</article>\n\n";