Skip to content

Commit

Permalink
Add pubDate to new style rss feeds, add itunes info to old style podc…
Browse files Browse the repository at this point in the history
…ast feeds (synchronize features between new and old styles)
  • Loading branch information
dleffler committed Feb 26, 2011
1 parent c3b1b43 commit a60cac7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions site_rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit a60cac7

Please sign in to comment.