login/pass: error messages below page title
[minimedit.git] / widget / nieuws.php
index dd019a3be60abcfee2dd1ade4375646edfc09f0d..10e31a3c97b9f8fff0cab5469609035b85aedc2c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 if (!function_exists('shownews')) {
-function shownews($input, $limit = 1000)
+function shownews($input, $limit = 1000, $abbr = FALSE)
 {
        if (!is_array($input)) $input = glob("$input/*.html");
        print "<div>\n";
@@ -19,7 +19,16 @@ function shownews($input, $limit = 1000)
                        '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
                        $article->link, $article->title, showdate($article->dateparts)
                );
-               print $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";
 
@@ -73,6 +82,6 @@ if (@$Page->place['view'] === 'toc') {
        return;
 }
 ob_start();
-shownews($articles, @$Page->place['n'] ?: 5);
+shownews($articles, @$Page->place['n'] ?: 5, !empty($Page->place['teaser']));
 $Page->raw = ob_get_clean();
 print $Page->render();