Exemplo n.º 1
0
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $id = JRequest::getCmd('id', '0');
     $category = EasyBlogHelper::getTable('Category', 'Table');
     $category->load($id);
     // private category shouldn't allow to access.
     $privacy = $category->checkPrivacy();
     if (!$privacy->allowed) {
         return;
     }
     $catIds = array();
     $catIds[] = $category->id;
     EasyBlogHelper::accessNestedCategoriesId($category, $catIds);
     $model = $this->getModel('Blog');
     $posts = $model->getBlogsBy('category', $catIds);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_CATEGORY_DESC', $this->escape($category->title)));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=categories&id=' . $id . '&format=weever', false, true));
     $weever->set('thisPage', 1);
     $weever->set('lastPage', 1);
     if ($posts) {
         foreach ($posts as $post) {
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($post->id);
             $weever->addChild($blog);
         }
     }
     $weever->toJSON(true, JRequest::getVar('callback'));
 }
Exemplo n.º 2
0
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $id = JRequest::getInt('id');
     $team = EasyBlogHelper::getTable('TeamBlog');
     $team->load($id);
     if ($team->access != EBLOG_TEAMBLOG_ACCESS_EVERYONE) {
         return;
     }
     $model = $this->getModel('Blog');
     $posts = $model->getBlogsBy('teamblog', $team->id);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_TEAMBLOGS_DESC', $team->title));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=teamblog&id=' . $id . '&format=weever', false, true));
     $weever->set('thisPage', 1);
     $weever->set('lastPage', 1);
     if ($posts) {
         foreach ($posts as $post) {
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($post->id);
             $weever->addChild($blog);
         }
     }
     $weever->toJSON(true, JRequest::getVar('callback'));
 }
Exemplo n.º 3
0
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $model = $this->getModel('Blog');
     $posts = $model->getBlogsBy('', '', 'latest', 0, EBLOG_FILTER_PUBLISHED, null, true);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_LATEST_DESC', JURI::root()));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=latest', false, true));
     $weever->set('thisPage', 1);
     $weever->set('lastPage', 1);
     foreach ($posts as $post) {
         $blog = EasyBlogHelper::getTable('Blog');
         $blog->load($post->id);
         $weever->addChild($blog);
     }
     $weever->toJSON(true, JRequest::getVar('callback'));
 }
Exemplo n.º 4
0
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $id = JRequest::getInt('id');
     $blogger = EasyBlogHelper::getTable('Profile', 'Table');
     $blogger->load($id);
     $model = $this->getModel('Blog');
     $posts = $model->getBlogsBy('blogger', $blogger->id);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', strip_tags($blogger->description));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=blogger&id=' . $id . '&format=weever', false, true));
     $weever->set('thisPage', 1);
     $weever->set('lastPage', 1);
     if ($posts) {
         foreach ($posts as $post) {
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($post->id);
             $weever->addChild($blog);
         }
     }
     $weever->toJSON(true, JRequest::getVar('callback'));
 }
Exemplo n.º 5
0
 function display($tmpl = null)
 {
     $config = EasyBlogHelper::getConfig();
     $id = JRequest::getCmd('id', '0');
     $tag = EasyBlogHelper::getTable('Tag');
     $tag->load($id);
     $model = $this->getModel('Blog');
     $posts = $model->getTaggedBlogs($id);
     $weever = EasyBlogHelper::getHelper('Weever')->getMainFeed();
     $weever->set('description', JText::sprintf('COM_EASYBLOG_FEEDS_TAGS_DESC', htmlentities($tag->title)));
     $weever->set('url', EasyBlogRouter::getRoutedUrl('index.php?option=com_easyblog&view=categories&id=' . $id . '&format=weever', false, true));
     $weever->set('thisPage', 1);
     $weever->set('lastPage', 1);
     if ($posts) {
         foreach ($posts as $post) {
             $blog = EasyBlogHelper::getTable('Blog');
             $blog->load($post->id);
             $weever->addChild($blog);
         }
     }
     $weever->toJSON(true, JRequest::getVar('callback'));
 }
Exemplo n.º 6
0
 public function getWeeverURL($url)
 {
     require_once EBLOG_HELPERS . DIRECTORY_SEPARATOR . 'router.php';
     $sef = EasyBlogRouter::isSefEnabled();
     $join = $sef ? '?' : '&';
     $url = EasyBlogRouter::getRoutedUrl($url, false, true) . $join . 'format=weever';
     return $url;
 }