Beispiel #1
0
 public function get_index()
 {
     $articles = cmsHelper::getAllArticles($message, true);
     //get the article limit size
     $articles = $articles->where('status', '=', 1)->paginate(Setting::find(2)->value);
     $dbquery = $articles;
     $articles = cmsHelper::bakeArticleForViewers($articles->results);
     return View::make('visitor.index', array("articles" => $articles, 'dbquery' => $dbquery));
 }
Beispiel #2
0
 public function get_view()
 {
     $articles = null;
     $message = "show all";
     $orderby = 'id';
     if (isset($_GET['sortby'])) {
         $orderby = $_GET['sortby'];
     }
     if (isset($_GET['filterby'])) {
         if ($_GET['filterby'] === "tag") {
             $articles = cmsHelper::getAllArticlesByTagUrl($_GET['value'], $message, $orderby);
         } else {
             if ($_GET['filterby'] === "category") {
                 $articles = cmsHelper::getAllArticlesByCategoryUrl($_GET['value'], $message, $orderby);
             } else {
                 if ($_GET['filterby'] === "author") {
                     $articles = cmsHelper::getAllArticlesByAuthorId($_GET['value'], $message, $orderby);
                 } else {
                     if ($_GET['filterby'] === "status") {
                         $articles = cmsHelper::getAllArticlesByStatus($_GET['value'], $message, $orderby);
                     } else {
                         if ($_GET['filterby'] === "search") {
                             $articles = cmsHelper::getAllArticlesBySearch($_GET['value'], $message, $orderby);
                         }
                     }
                 }
             }
         }
     } else {
         $articles = cmsHelper::getAllArticles($message, false, $orderby);
     }
     $filterdQueryStringArray = array();
     $output = null;
     parse_str($_SERVER['QUERY_STRING'], $filterdQueryStringArray);
     unset($filterdQueryStringArray['page']);
     $output = $filterdQueryStringArray;
     unset($filterdQueryStringArray['sortby']);
     return View::make("admin.ArticleMgt.list", array('articles' => $articles, 'message' => $message, 'filterdQueryString' => cmsHelper::getArrayToString($filterdQueryStringArray), 'filterdQueryStringArray' => $output));
 }