Esempio n. 1
0
 public function action_forum()
 {
     $this->auto_render = FALSE;
     $info = array('title' => 'RSS Forum ' . Core::config('general.site_name'), 'pubDate' => date("r"), 'description' => __('Latest post published'), 'generator' => 'Open Classifieds');
     $items = array();
     $topics = new Model_Topic();
     if (Model_Forum::current()->loaded()) {
         $topics->where('id_forum', '=', Model_Forum::current()->id_forum);
     } else {
         $topics->where('id_forum', '!=', NULL);
     }
     //any forum
     $topics = $topics->where('status', '=', Model_Topic::STATUS_ACTIVE)->where('id_post_parent', 'IS', NULL)->order_by('created', 'desc')->limit(Core::config('advertisement.feed_elements'))->cached()->find_all();
     foreach ($topics as $topic) {
         $url = Route::url('forum-topic', array('seotitle' => $topic->seotitle, 'forum' => $topic->forum->seoname));
         $items[] = array('title' => htmlspecialchars($topic->title, ENT_QUOTES), 'link' => $url, 'pubDate' => Date::mysql2unix($topic->created), 'description' => htmlspecialchars(Text::removebbcode($topic->description), ENT_QUOTES), 'guid' => $url);
     }
     $xml = Feed::create($info, $items);
     $this->response->headers('Content-type', 'text/xml');
     $this->response->body($xml);
 }
Esempio n. 2
0
    ?>
" href="<?php 
    echo Route::url('rss-forum');
    ?>
" />
  <?php 
    if (Model_Forum::current()->loaded()) {
        ?>
  <link rel="alternate" type="application/atom+xml" title="RSS Forum <?php 
        echo HTML::chars(Core::config('general.site_name'));
        ?>
 - <?php 
        echo Model_Forum::current()->name;
        ?>
" href="<?php 
        echo Route::url('rss-forum', array('forum' => Model_Forum::current()->seoname));
        ?>
" />
  <?php 
    }
}
if (Model_User::current() != NULL and Model_User::current()->loaded()) {
    ?>
  <link rel="alternate" type="application/atom+xml" title="RSS Profile - <?php 
    echo HTML::chars(Model_User::current()->name);
    ?>
" href="<?php 
    echo Route::url('rss-profile', array('seoname' => Model_User::current()->seoname));
    ?>
" />
  <?php