get_content() 공개 메소드

Prefers full content over summaries, but will return a summary if full content does not exist. To prefer summaries instead, use {@see \get_description} Uses or (RSS 1.0 Content Module)
부터: 1.0
public get_content ( boolean $content_only = false ) : string | null
$content_only boolean Should we avoid falling back to the description?
리턴 string | null
예제 #1
0
 /**
  * Parses a since feed item.
  *
  * @param \Devour\Table\TableInterface $table
  *   A table obeject.
  * @param \SimplePie_Item $item
  *   A SimplePie item.
  */
 protected function parseItem(TableInterface $table, \SimplePie_Item $item)
 {
     // @todo Add more fields.
     $row = $table->getNewRow();
     $row->set('id', $item->get_id())->set('permalink', $item->get_permalink())->set('title', $item->get_title())->set('date', $item->get_gmdate('U'))->set('content', $item->get_content());
     if ($author = $item->get_author()) {
         $row->set('author_name', $author->get_name())->set('author_email', $author->get_email());
     }
 }
예제 #2
0
 /**
  * The constructor stores feed item attributes as properties.
  * 
  * @param type $feed the feed the new item belongs to
  * @param SimplePie_Item $item SimplePie_Item that contains information
  * about the item
  */
 public function __construct($feed, $item)
 {
     $this->_feed = $feed;
     $this->_title = $item->get_title();
     $this->_link = $item->get_permalink();
     $this->_description = $item->get_content();
     $this->_date = $item->get_date('U');
     $author = $item->get_author();
     $author_name = $author ? $author->get_name() : NULL;
     $this->_author = $author && empty($author_name) ? $author->get_email() : $author_name;
 }
예제 #3
0
function filter(SimplePie_Item $item, array $patterns)
{
    foreach ($patterns as $pattern) {
        switch ($pattern["field"]) {
            case "title":
                if (preg_match($pattern["regex"], $item->get_title())) {
                    return false;
                }
                break;
            case "summary":
                if (preg_match($pattern["regex"], $item->get_description())) {
                    return false;
                }
                break;
            case "content":
                if (preg_match($pattern["regex"], $item->get_content())) {
                    return false;
                }
                break;
            case "url":
                if (preg_match($pattern["regex"], $item->get_permalink())) {
                    return false;
                }
                break;
            case "category":
                foreach ($item->get_categories() as $category) {
                    if (preg_match($pattern["regex"], $category->get_term()) || preg_match($pattern["regex"], $category->get_label())) {
                        return false;
                    }
                }
                break;
            default:
                die("Filter not implemented for field " . $pattern["field"]);
        }
    }
    return true;
}
예제 #4
0
 function get_content($content_only = false)
 {
     return apply_filters('feedwordpie_item_get_content', parent::get_content($content_only), $content_only, $this);
 }
예제 #5
0
 /**
  * Populate an item from a feed item
  *
  * @param $item \Planetflow3\Domain\Model\Item
  * @param $feedItem \SimplePie_Item
  * @return void
  */
 protected function populateItemProperties(Item $item, \SimplePie_Item $feedItem)
 {
     $item->setLink($feedItem->get_link());
     $item->setTitle($feedItem->get_title());
     $item->setDescription($feedItem->get_description());
     $item->setContent($feedItem->get_content(TRUE));
     $item->setPublicationDate(new \DateTime($feedItem->get_date()));
     $item->setAuthor($feedItem->get_author());
 }
 /**
  * @return string twitterified content
  */
 function get_content($content_only = false)
 {
     $content = $this->twitterify(parent::get_content($content_only));
     return $content;
 }