diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-07-09 13:18:57 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-07-09 13:18:57 -0400 |
commit | 69574591d0ac429475b1099e8d9f3e46f7a004ea (patch) | |
tree | 02ff2ef5709bfbf77cad3e04d75e81cb771d2c27 /classes | |
parent | d2e83b6a67fec311f9bc36a7d886f40169d9de15 (diff) |
Notice attachments are enclosures in feeds (Atom, RSS 1.0/RDF, and RSS 2.0).
http://laconi.ca/trac/ticket/1690
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 12 |
1 files changed, 12 insertions, 0 deletions
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(); |