Inheritance: extends SpoonFeedRSS
Beispiel #1
0
 /**
  * Parse the data into the template
  */
 private function parse()
 {
     // get vars
     $title = \SpoonFilter::ucfirst(FL::msg('BlogAllComments'));
     $link = SITE_URL . FrontendNavigation::getURLForBlock('Blog');
     $detailLink = SITE_URL . FrontendNavigation::getURLForBlock('Blog', 'Detail');
     $description = null;
     // create new rss instance
     $rss = new FrontendRSS($title, $link, $description);
     // loop articles
     foreach ($this->items as $item) {
         // init vars
         $title = $item['author'] . ' ' . FL::lbl('On') . ' ' . $item['post_title'];
         $link = $detailLink . '/' . $item['post_url'] . '/#comment-' . $item['id'];
         $description = $item['text'];
         // create new instance
         $rssItem = new FrontendRSSItem($title, $link, $description);
         // set item properties
         $rssItem->setPublicationDate($item['created_on']);
         $rssItem->setAuthor($item['author']);
         // add item
         $rss->addItem($rssItem);
     }
     $rss->parse();
 }
Beispiel #2
0
 /**
  * Parse the data into the template
  */
 private function parse()
 {
     // get vars
     $title = isset($this->settings['rss_title_' . LANGUAGE]) ? $this->settings['rss_title_' . LANGUAGE] : $this->get('fork.settings')->get('Blog', 'rss_title_' . LANGUAGE, SITE_DEFAULT_TITLE);
     $link = SITE_URL . FrontendNavigation::getURLForBlock('Blog');
     $description = isset($this->settings['rss_description_' . LANGUAGE]) ? $this->settings['rss_description_' . LANGUAGE] : null;
     // create new rss instance
     $rss = new FrontendRSS($title, $link, $description);
     // loop articles
     foreach ($this->items as $item) {
         // init vars
         $title = $item['title'];
         $link = $item['full_url'];
         $description = $item['introduction'] != '' ? $item['introduction'] : $item['text'];
         // meta is wanted
         if ($this->get('fork.settings')->get('Blog', 'rss_meta_' . LANGUAGE, true)) {
             // append meta
             $description .= '<div class="meta">' . "\n";
             $description .= '    <p><a href="' . $link . '" title="' . $title . '">' . $title . '</a> ' . sprintf(FL::msg('WrittenBy'), FrontendUser::getBackendUser($item['user_id'])->getSetting('nickname'));
             $description .= ' ' . FL::lbl('In') . ' <a href="' . $item['category_full_url'] . '" title="' . $item['category_title'] . '">' . $item['category_title'] . '</a>.</p>' . "\n";
             // any tags
             if (isset($item['tags'])) {
                 // append tags-paragraph
                 $description .= '    <p>' . \SpoonFilter::ucfirst(FL::lbl('Tags')) . ': ';
                 $first = true;
                 // loop tags
                 foreach ($item['tags'] as $tag) {
                     // prepend separator
                     if (!$first) {
                         $description .= ', ';
                     }
                     // add
                     $description .= '<a href="' . $tag['full_url'] . '" rel="tag" title="' . $tag['name'] . '">' . $tag['name'] . '</a>';
                     // reset
                     $first = false;
                 }
                 // end
                 $description .= '.</p>' . "\n";
             }
             // end HTML
             $description .= '</div>' . "\n";
         }
         // create new instance
         $rssItem = new FrontendRSSItem($title, $link, $description);
         // set item properties
         $rssItem->setPublicationDate($item['publish_on']);
         $rssItem->addCategory($item['category_title']);
         $rssItem->setAuthor(FrontendUser::getBackendUser($item['user_id'])->getSetting('nickname'));
         // add item
         $rss->addItem($rssItem);
     }
     // output
     $rss->parse();
 }