From 69574591d0ac429475b1099e8d9f3e46f7a004ea Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Thu, 9 Jul 2009 13:18:57 -0400 Subject: Notice attachments are enclosures in feeds (Atom, RSS 1.0/RDF, and RSS 2.0). http://laconi.ca/trac/ticket/1690 --- classes/Notice.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'classes/Notice.php') diff --git a/classes/Notice.php b/classes/Notice.php index 5ec0692d9..e975cab93 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1164,6 +1164,18 @@ class Notice extends Memcached_DataObject } $tag->free(); + # Enclosures + $attachments = $this->attachments(); + if($attachments){ + foreach($attachments as $attachment){ + $attributes = array('rel'=>'enclosure','href'=>$attachment->url,'type'=>$attachment->mimetype,'length'=>$attachment->size); + if($attachment->title){ + $attributes['title']=$attachment->title; + } + $xs->element('link', $attributes, null); + } + } + $xs->elementEnd('entry'); return $xs->getString(); -- cgit v1.2.3-54-g00ecf