📄 feedforall_xmlparser.inc.php
字号:
elseif (($tagName == "DESCRIPTION") || ($tagName == "TAGLINE")) { $this->FeedDescription = trim($this->FeedDescription); } elseif ($tagName == "CONTENT:ENCODED") { $this->FeedContentEncoded = trim($this->FeedContentEncoded); } elseif ($tagName == "LINK") { $this->FeedLink = trim($this->FeedLink); } } elseif ($tagName == "CONTENT") { if ($this->insideItem == TRUE) { // Lets look to see if the content is if ($this->currentItem->atomContentStartPos) { // // The the whole <content ... > string $pos = xml_get_current_byte_index($parser); for (;$pos > 0; $pos--) { /* Look for a closing angle */ if ($this->wholeString[$pos] == ">") break; } $pos++; $hereToEnd = substr($this->wholeString, $pos); $closePos = strpos($hereToEnd, ">"); $fullContentText = substr($this->wholeString, $this->currentItem->atomContentStartPos, $pos + $closePos - $this->currentItem->atomContentStartPos+1); // Find the end of <content $start = strpos($fullContentText, ">"); $fullContentText = substr($fullContentText, $start+1); // Find the end of <div $start = strpos($fullContentText, ">"); $fullContentText = substr($fullContentText, $start+1); // Find the start of </content $start = strrpos($fullContentText, "<"); $fullContentText = substr($fullContentText, 0, $start-1); // Find the start of </div $start = strrpos($fullContentText, "<"); $this->currentItem->atomContent = substr($fullContentText, 0, $start-1); $this->currentItem->atomContentStartPos = 0; } } else { // Lets look to see if the content is if ($this->FeedAtomContentStartPos) { // // The the whole <content ... > string $pos = xml_get_current_byte_index($parser); for (;$pos > 0; $pos--) { /* Look for a closing angle */ if ($this->wholeString[$pos] == ">") break; } $pos++; $hereToEnd = substr($this->wholeString, $pos); $closePos = strpos($hereToEnd, ">"); $fullContentText = substr($this->wholeString, $this->FeedAtomContentStartPos, $pos + $closePos - $this->FeedAtomContentStartPos+1); // Find the end of <content $start = strpos($fullContentText, ">"); $fullContentText = substr($fullContentText, $start+1); // Find the end of <div $start = strpos($fullContentText, ">"); $fullContentText = substr($fullContentText, $start+1); // Find the start of </content $start = strrpos($fullContentText, "<"); $fullContentText = substr($fullContentText, 0, $start-1); // Find the start of </div $start = strrpos($fullContentText, "<"); $this->FeedAtomContent = substr($fullContentText, 0, $start-1); $this->FeedAtomContentStartPos = 0; } } } if (FeedForAll_parseExtensions() === TRUE) { FeedForAll_parseExtensions_endElemend($parser, $this, $tagName); } } 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); } } } }}if (function_exists("FeedForAll_parseExtensions_extendParserClass")) { $currentBaseClassName = FeedForAll_parseExtensions_extendParserClass("rootRSSParserClass");} else { $currentBaseClassName = "rootRSSParserClass";}eval('class baseParserClassWithExtensions extends ' . $currentBaseClassName . ' {}');class baseParserClass extends baseParserClassWithExtensions { Function baseParserClass($operateAs) { $parentClass = get_parent_class($this); $this->$parentClass($operateAs); }}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -