Permalink
Browse files

Fix for issue 1 rss feed, also adds version number to feed.

  • Loading branch information...
1 parent 8bc63c7 commit bb1d7e439f8b26055bacd0a5da9e55f9cdad9408 @rbtylee rbtylee committed Apr 19, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 app/views/software/rss/generatefeed.ctp
@@ -1,16 +1,20 @@
<?php
function rss_transform($item) {
App::import('Sanitize');
- $title = str_replace("_"," ",$item['Software']['softName']);
+ #Architecture Label workaround.
+ $archLabel = array('i386'=>'Desktop','armel'=>'Mobile','x86_64'=>'Work Station');
+ $title = str_replace("_"," ",$item['Software']['softName']."/ ".$archLabel[$item['Software']['arch']]);
return array('title' => $title,
- 'link' => array('controller' => 'software', 'action' => 'showDesc', $item['Software']['softName']),
- 'guid' => array('controller' => 'software', 'action' => 'showDesc', $item['Software']['softName']),
- 'description' => Sanitize::stripAll($item['Software']['softDesc']),
- 'pubDate' => $item['Software']['entry_date'],
- );
+ 'link' => array('controller' => 'software', 'action' => 'showDesc', $item['Software']['softName'], $item['Software']['arch']),
@rbtylee

rbtylee Apr 21, 2012

Owner

If softName ends in a blank this link is messed up.

+ 'guid' => array('controller' => 'software', 'action' => 'showDesc', $item['Software']['softName'], $item['Software']['arch']),
+ # Add version hack: layout is correct only if softDesc is proper HTML
+ # for example if it starts with <p>
+ 'description' => Sanitize::stripAll("Version: ".$item['Software']['version'].$item['Software']['softDesc']),
+ 'pubDate' => $item['Software']['entry_date']
+ );
}
-
+
$this->set('items', $rss->items($software, 'rss_transform'));
-
+
$this->set('channelData', $channelData);
?>

0 comments on commit bb1d7e4

Please sign in to comment.