diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 4 | ||||
-rw-r--r-- | lib/rssaction.php | 9 | ||||
-rw-r--r-- | lib/twitterapi.php | 21 |
3 files changed, 32 insertions, 2 deletions
diff --git a/lib/action.php b/lib/action.php index da5b48858..95ee10c64 100644 --- a/lib/action.php +++ b/lib/action.php @@ -772,7 +772,9 @@ class Action extends HTMLOutputter // lawsuit $this->elementStart('p'); $this->element('img', array('id' => 'license_cc', 'src' => common_config('license', 'image'), - 'alt' => common_config('license', 'title'))); + 'alt' => common_config('license', 'title'), + 'width' => '80', + 'height' => '15')); //TODO: This is dirty: i18n $this->text(_('All '.common_config('site', 'name').' content and data are available under the ')); $this->element('a', array('class' => 'license', diff --git a/lib/rssaction.php b/lib/rssaction.php index 0c8188e88..fe3fd6f4a 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -216,6 +216,13 @@ class Rss10Action extends Action $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); $this->element('sioc:reply_of', array('rdf:resource' => $replyurl)); } + $attachments = $notice->attachments(); + if($attachments){ + foreach($attachments as $attachment){ + $this->element('enc:enclosure', array('rdf:resource'=>$attachment->url,'enc:type'=>$attachment->mimetype,'enc:length'=>$attachment->size), null); + } + } + $this->elementEnd('item'); $this->creators[$creator_uri] = $profile; } @@ -251,6 +258,8 @@ class Rss10Action extends Action 'http://creativecommons.org/ns#', 'xmlns:content' => 'http://purl.org/rss/1.0/modules/content/', + 'xmlns:enc' => + 'http://purl.oclc.org/net/rss_2.0/enc#', 'xmlns:foaf' => 'http://xmlns.com/foaf/0.1/', 'xmlns:sioc' => diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 40e5b5067..8f902cbca 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -207,7 +207,6 @@ class TwitterapiAction extends Action function twitter_rss_entry_array($notice) { - $profile = $notice->getProfile(); $entry = array(); @@ -224,6 +223,19 @@ class TwitterapiAction extends Action $entry['updated'] = $entry['published']; $entry['author'] = $profile->getBestName(); + # Enclosure + $attachments = $notice->attachments(); + if($attachments){ + $entry['enclosures']=array(); + foreach($attachments as $attachment){ + $enclosure=array(); + $enclosure['url']=$attachment->url; + $enclosure['mimetype']=$attachment->mimetype; + $enclosure['size']=$attachment->size; + $entry['enclosures'][]=$enclosure; + } + } + # RSS Item specific $entry['description'] = $entry['content']; $entry['pubDate'] = common_date_rfc2822($notice->created); @@ -378,6 +390,13 @@ class TwitterapiAction extends Action $this->element('pubDate', null, $entry['pubDate']); $this->element('guid', null, $entry['guid']); $this->element('link', null, $entry['link']); + + # RSS only supports 1 enclosure per item + if($entry['enclosures']){ + $enclosure = $entry['enclosures'][0]; + $this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null); + } + $this->elementEnd('item'); } |