Example #1
0
 public function getfeature_Blog()
 {
     $app = JFactory::getApplication();
     $limit = $app->input->get('limit', 10, 'INT');
     $categories = $app->input->get('categories', '', 'STRING');
     $blogss = new EasyBlogModelBlog();
     $blogss->setState('limit', $limit);
     $res = $blogss->getFeaturedBlog(array(), $limit);
     return $res;
 }
Example #2
0
 public function getBlogComment($blogId, $limistFrontEnd = 0, $sort = 'asc', $isLite = false)
 {
     $config = EasyBlogHelper::getConfig();
     $comments = array();
     require_once EBLOG_MODELS . DIRECTORY_SEPARATOR . 'blog.php';
     $model = new EasyBlogModelBlog();
     $comments = $model->getBlogComment($blogId, $limistFrontEnd, $sort, $isLite);
     $this->pagination = $model->getPagination();
     return $comments;
 }
Example #3
0
 public function addToBlogsubscribe()
 {
     $app = JFactory::getApplication();
     $email = $app->input->get('email', '', 'STRING');
     $userid = $app->input->get('userid', '', 'STRING');
     $name = $app->input->get('name', '', 'STRING');
     $blogid = $app->input->get('blogid', 0, 'INT');
     $res = new stdClass();
     $bmodel = new EasyBlogModelBlog();
     $status = $bmodel->isBlogSubscribedUser($blogid, $userid, $email);
     if (!$status) {
         $result = $bmodel->addBlogSubscription($blogid, $email, $userid, $name);
         $res->status = 1;
         $res->message = 'subscription successful';
     } else {
         $res->status = 0;
         $res->message = 'You are already subscribed for this blog';
         return $res;
     }
     return $res;
 }