]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add w3dtf date to rss 1.0 items
authorEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 14:59:16 +0000 (10:59 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 14:59:16 +0000 (10:59 -0400)
darcs-hash:20080521145916-84dde-4a5e04edb1bdcdb5e33bed7497dcf93be88636f8.gz

actions/rss10.php
lib/util.php

index f717f17cf1fa7f4c794d459680d96155576293c3..bae4e86524fc0d631b724aea489277dcce7495b8 100644 (file)
@@ -50,6 +50,8 @@ class Rss10Action extends Action {
                common_start_xml();
                common_element_start('rdf:RDF', array('xmlns:rdf' =>
                                                                                          'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+                                                                                         'xmlns:dc' =>
+                                                                                         'http://purl.org/dc/elements/1.1/',
                                                                                          'xmlns' => 'http://purl.org/rss/1.0/'));
 
                $notices = $this->get_notices($user, $limit);
@@ -120,11 +122,12 @@ class Rss10Action extends Action {
        }
        
        function show_item($notice) {
-               $nurl = common_local_url('shownotice', array('notice' => $n->id));
+               $nurl = common_local_url('shownotice', array('notice' => $notice->id));
                common_element_start('item', array('rdf:about' => $nurl));
                common_element('title', NULL, $notice->created);
                common_element('link', NULL, $nurl);
                common_element('description', NULL, common_render_content($notice->content));
+               common_element('dc:date', NULL, common_date_w3dtf($notice->created));
                common_element_end('item');
        }
 }
\ No newline at end of file
index 8b013c6457a59c70ce5dbab3b623b86165ec99c3..052f35fdd950b6b1439cd91ed723b7b72dda6c5b 100644 (file)
@@ -380,6 +380,11 @@ function common_date_string($dt) {
        return $dt;
 }
 
+function common_date_w3dtf($dt) {
+       $t = strtotime($dt);
+       return date(DATE_W3C, $t);
+}
+
 function common_redirect($url, $code=307) {
        static $status = array(301 => "Moved Permanently",
                                                   302 => "Found",