Permalink
Browse files

Add pubDate to new style rss feeds, add itunes info to old style podc…

…ast feeds (synchronize features between new and old styles)
  • Loading branch information...
1 parent c3b1b43 commit a60cac713a7106ff7964fca6dab683e3dd724add @dleffler dleffler committed Feb 26, 2011
Showing with 15 additions and 0 deletions.
  1. +12 −0 rss.php
  2. +3 −0 site_rss.php
View
12 rss.php
@@ -42,6 +42,7 @@
$itemdate[] = strtotime($item->date);
}
$pubDate = date('r', max($itemdate));
+
//get the modules config data which should have the feed title & desc
$config = $db->selectObject($module."_config", "location_data='".serialize($location)."'");
$ttl = $config->rss_cachetime;
@@ -56,6 +57,17 @@
$rss->pubDate = $pubDate;
$rss->link = "http://".HOSTNAME.PATH_RELATIVE;
$rss->syndicationURL = "http://".HOSTNAME.PATH_RELATIVE.$_SERVER['PHP_SELF'];
+ if ($_REQUEST['module'] == "resourcesmodule") {
+ $rss->itunes->summary = $config->feed_desc;
+ $rss->itunes->author = ORGANIZATION_NAME;
+ $rss->itunes->category = '';
+ $rss->itunes->subcategory = '';
+ $rss->itunes->image = URL_FULL."framework/modules/filedownloads/assets/images/logo.png";
+ $rss->itunes->explicit = 0;
+ $rss->itunes->subtitle = 0;
+ $rss->itunes->keywords = 0;
+ $rss->itunes->owner_email = 0;
+ }
foreach ($rss_items as $item) {
$rss->addItem($item);
View
@@ -73,9 +73,12 @@
$rss->itunes->owner_email = 0;
}
+ $pubDate = '';
foreach ($site_rss->getFeedItems() as $item) {
+ if ($item->date > $pubDate) { $pubDate = $item->date; }
$rss->addItem($item);
}
+ $rss->pubDate = $pubDate;
header("Content-type: text/xml");
if ($_REQUEST['module'] == "filedownload") {

0 comments on commit a60cac7

Please sign in to comment.