nieuws/feed: atom export of articles
[minimedit.git] / nieuws.inc.php
index a925a9139d331c2b24c65e7d022c384d6969fd1c..c5dfa2331344503746cca81fbeebcd9128dacfb4 100644 (file)
@@ -42,10 +42,30 @@ class ArchiveArticle
                return strip_tags($this->title);
        }
 
+       function last()
+       {
+               return filemtime($this->page);
+       }
+
+       function lastiso()
+       {
+               return date(DATE_ATOM, $this->last);
+       }
+
+       function dateparts()
+       {
+               preg_match('</(\d{4})/(\d{2})-(\d{2})->', $this->page, $ymd);
+               return $ymd;
+       }
+
+       function dateiso()
+       {
+               return implode('-', $this->dateparts());
+       }
+
        function date()
        {
-               if (!preg_match('</(\d{4})/(\d{2})-(\d{2})->', $this->page, $parts)) return;
-               return showdate($parts);
+               return showdate($this->dateparts);
        }
 
        function body()