function FeedForALL_rss2html_replaceInItem($source, $currentItem) { global $limitFeedTitleLength; global $limitFeedDescriptionLength; global $limitItemTitleLength; global $limitItemDescriptionLength; global $LongDateFormat; global $ShortDateFormat; global $LongTimeFormat; global $ShortTimeFormat; global $XMLfilename; $item = FeedForAll_rss2html_str_replace("~~~ItemTitle~~~", FeedForAll_rss2html_limitLength($currentItem->title, $limitItemTitleLength), $source); $item = FeedForAll_rss2html_str_replace("~~~ItemDescription~~~", FeedForAll_rss2html_limitLength($currentItem->description, $limitItemDescriptionLength), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemEnclosureLengthFormatted~~~", FeedForAll_rss2html_sizeToString($currentItem->enclosureLength), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubLongDate~~~", date($LongDateFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubShortDate~~~", date($ShortDateFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubLongTime~~~", date($LongTimeFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubShortTime~~~", date($ShortTimeFormat, $currentItem->pubDate_t), $item); $knownFields = $currentItem->getArrayOfFields(); foreach ($knownFields as $field) { $item = FeedForAll_rss2html_str_replace($field, $currentItem->getValueOf($field), $item); } $item = FeedForAll_rss2html_CreateUniqueLink($currentItem->title, $currentItem->description, $currentItem->link, $currentItem->guid, $XMLfilename, $item); if (FeedForAll_parseExtensions() === TRUE) { $item = FeedForAll_parseExtensions_replaceInItem($currentItem, $item); } return FeedForAll_rss2html_AddIdentity($item); }
function FeedForALL_rss2html_replaceInItem($source, $currentItem) { global $limitFeedTitleLength; global $limitFeedDescriptionLength; global $limitItemTitleLength; global $limitItemDescriptionLength; global $LongDateFormat; global $ShortDateFormat; global $LongTimeFormat; global $ShortTimeFormat; global $XMLfilename; $item = FeedForAll_rss2html_str_replace("~~~ItemTitle~~~", FeedForAll_rss2html_limitLength($currentItem->title, $limitItemTitleLength), $source); $item = FeedForAll_rss2html_str_replace("~~~ItemDescription~~~", FeedForAll_rss2html_limitLength($currentItem->description, $limitItemDescriptionLength), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemEnclosureLengthFormatted~~~", FeedForAll_rss2html_sizeToString($currentItem->enclosureLength), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubLongDate~~~", date($LongDateFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubShortDate~~~", date($ShortDateFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubLongTime~~~", date($LongTimeFormat, $currentItem->pubDate_t), $item); $item = FeedForAll_rss2html_str_replace("~~~ItemPubShortTime~~~", date($ShortTimeFormat, $currentItem->pubDate_t), $item); $knownFields = $currentItem->getArrayOfFields(); foreach ($knownFields as $field) { $item = FeedForAll_rss2html_str_replace($field, $currentItem->getValueOf($field), $item); } // //OpenStack Edits To Add Source Class To Items // //Look to see if the item's link contains OpenStack if (strpos($currentItem->link, "openstack.org") !== false) { $feedSourceType = "Blog"; //Look to see if the item's link contains Twitter } elseif (strpos($currentItem->link, "twitter.com") !== false) { $feedSourceType = "Twitter"; } else { $feedSourceType = "Web"; } $item = FeedForAll_rss2html_str_replace("~~~SourceType~~~", $feedSourceType, $item); $item = FeedForAll_rss2html_CreateUniqueLink($currentItem->title, $currentItem->description, $currentItem->link, $currentItem->guid, $XMLfilename, $item); if (FeedForAll_parseExtensions() === TRUE) { $item = FeedForAll_parseExtensions_replaceInItem($currentItem, $item); } return FeedForAll_rss2html_AddIdentity($item); }