page: replace output caching by article object
[minimedit.git] / nieuws / feed / index.php
index 72c22074c2af16b1649620522a3225ba26457fca..00fa7ea3dcb585c642caee99ee2e85c7e9ae5230 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-ob_clean();
 header('Content-Type: application/atom+xml; charset=utf-8');
 print '<?xml version="1.0" encoding="utf-8"?>';
 $siteref = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'];
@@ -30,9 +29,10 @@ foreach ($pages as $i => $page) {
                <title><?= $article->title ?></title>
                <published><?= $article->dateiso ?></published>
                <updated><?= $article->dateiso ?></updated>
-               <content type="html"><?= htmlspecialchars($article->story) ?>
-               </content>
 <?php
+       if ($article->teaser) {
+               printf("\t\t<summary>%s</summary>\n", htmlspecialchars($article->teaser));
+       }
        if ($article->thumb) {
                printf("\t\t".'<link rel="enclosure" type="%s" href="%s"%s />'."\n",
                        'image/jpeg',
@@ -41,6 +41,8 @@ foreach ($pages as $i => $page) {
                );
        }
 ?>
+               <content type="html"><?= htmlspecialchars($article->story) ?>
+               </content>
        </entry>
 <?php
 }