function characterData($parser, $data) { if ($data == "" || $data == NULL) { } else { if ($this->insideItem && $this->level == $this->level_item + 1) { switch ($this->tag) { case "TITLE": $this->currentItem->title .= $data; break; case "DESCRIPTION": $this->currentItem->description .= $data; break; case "CONTENT:ENCODED": $this->currentItem->contentEncodedUsed = 1; $this->currentItem->contentEncoded .= $data; break; case "SUMMARY": $this->currentItem->description .= $data; break; case "LINK": $this->currentItem->link .= $data; break; case "PUBDATE": $this->currentItem->pubDate .= $data; break; case "MODIFIED": $this->currentItem->pubDateDC .= $data; break; case "GUID": $this->currentItem->guid .= $data; break; case "ID": case "ATOM:ID": $this->currentItem->atomID .= $data; break; case "AUTHOR": $this->currentItem->author .= $data; break; case "COMMENTS": $this->currentItem->comments .= $data; break; case "SOURCE": $this->currentItem->source .= $data; break; case "CATEGORY": $this->currentItem->category .= $data; break; case "CREATIVECOMMONS:LICENSE": $this->currentItem->creativeCommons .= $data; break; case "RSSMESH:EXTRA": $this->currentItem->rssMeshExtra .= $data; break; case "RSSMESH:EXTRA1": $this->currentItem->rssMeshExtra1 .= $data; break; case "RSSMESH:EXTRA2": $this->currentItem->rssMeshExtra2 .= $data; break; case "RSSMESH:EXTRA3": $this->currentItem->rssMeshExtra3 .= $data; break; case "RSSMESH:FEEDIMAGETITLE": $this->currentItem->rssMeshFeedImageTitle .= $data; break; case "RSSMESH:FEEDIMAGEURL": $this->currentItem->rssMeshFeedImageUrl .= $data; break; case "RSSMESH:FEEDIMAGELINK": $this->currentItem->rssMeshFeedImageLink .= $data; break; case "RSSMESH:FEEDIMAGEDESCRIPTION": $this->currentItem->rssMeshFeedImageDescription .= $data; break; case "RSSMESH:FEEDIMAGEHEIGHT": $this->currentItem->rssMeshFeedImageHeight .= $data; break; case "RSSMESH:FEEDIMAGEWIDTH": $this->currentItem->rssMeshFeedImageWidth .= $data; break; case "UPDATED": case "ATOM:UPDATED": $this->currentItem->atomUpdated .= $data; break; case "CONTENT": case "ATOM:CONTENT": $this->currentItem->atomContent .= $data; break; default: if ($this->tag == "DC:DATE") { $this->currentItem->pubDateDC .= $data; } if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } elseif ($this->insideChannelImage) { switch ($this->tag) { case "TITLE": $this->FeedImageTitle .= $data; break; case "URL": $this->FeedImageURL .= $data; break; case "LINK": $this->FeedImageLink .= $data; break; case "DESCRIPTION": $this->FeedImageDescription .= $data; break; case "HEIGHT": $this->FeedImageHeight .= $data; break; case "WIDTH": $this->FeedImageWidth .= $data; break; default: if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } elseif ($this->insideChannel && $this->level == $this->level_channel + 1) { switch ($this->tag) { case "TITLE": $this->FeedTitle .= $data; break; case "DESCRIPTION": $this->FeedDescription .= $data; break; case "CONTENT:ENCODED": $this->FeedContentEncoded .= $data; break; case "TAGLINE": $this->FeedDescription .= $data; break; case "LINK": $this->FeedLink .= $data; break; case "PUBDATE": $this->FeedPubDate .= $data; break; case "MODIFIED": $this->FeedPubDateDC .= $data; break; case "LASTBUILDDATE": $this->FeedLastBuildDate .= $data; break; case "CREATIVECOMMONS:LICENSE": $this->FeedCreativeCommons .= $data; break; case "UPDATED": case "ATOM:UPDATED": $this->FeedAtomUpdated .= $data; break; case "CONTENT": case "ATOM:CONTENT": $this->FeedAtomContent .= $data; break; default: if ($this->tag == "DC:DATE") { $this->FeedPubDateDC .= $data; } if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } elseif ($this->insideAtomAuthor && $this->insideItem && $this->level == $this->level_item + 2) { switch ($this->tag) { case "EMAIL": case "ATOM:EMAIL": $this->currentItem->atomAuthorEmail .= $data; break; default: if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } elseif ($this->insideAtomAuthor && $this->insideChannel && $this->level == $this->level_channel + 2) { switch ($this->tag) { case "EMAIL": case "ATOM:EMAIL": $this->FeedAtomAuthorEmail .= $data; break; default: if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } else { if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_characterData($parser, $this, $data); } } } }
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); }