Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit a60cac713a7106ff7964fca6dab683e3dd724add 1 parent c3b1b43
dleffler dleffler authored
Showing with 15 additions and 0 deletions.
  1. +12 −0 rss.php
  2. +3 −0  site_rss.php
12 rss.php
View
@@ -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);
3  site_rss.php
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") {
Please sign in to comment.
Something went wrong with that request. Please try again.