]> git.wh0rd.org Git - tt-rss.git/commitdiff
generated feeds: support enclosures
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 11:40:55 +0000 (14:40 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 4 Nov 2010 11:40:55 +0000 (14:40 +0300)
functions.php

index 6eafe808224216f719a8d0709236271273fd62cf..601d59ecdc53a1af4edb4c163650598e8013c16e 100644 (file)
 
                        print sanitize_rss($link, $line["content_preview"], false, $owner_uid);
                        print "]]></description>";
-  
+       
+                       $enclosures = get_article_enclosures($link, $line["id"]);
+
+                       foreach ($enclosures as $e) {
+                               $type = htmlspecialchars($e['content_type']);
+                               $url = htmlspecialchars($e['content_url']);
+                               $length = $e['duration'];
+                               print "<enclosure url=\"$url\" type=\"$type\" length=\"$length\"/>";
+                       }
+
                        print "</item>";
                }