Example #1
0
 protected function input($param = array())
 {
     parent::input();
     // TODO: Change the autogenerated stub
     if (isset($param['page'])) {
         if ($param['page'] == 0) {
             $page = 1;
         } else {
             $page = (int) $param['page'];
         }
     } else {
         $page = 1;
     }
     $pager = new Pager($page, 'article', 1, 2);
     //     $this->page_array = ($pager->get_navigation());
     $this->title .= 'Каталог статей';
     $this->recent = $this->ob_model->recent_posts();
     $this->categories = $this->ob_model->get_categories();
     ///////////////
     $this->article_right = $this->render(TEMPLATE . 'inc/article_right', array('recent' => $this->recent, 'categories' => $this->categories));
     //если выбрана категория выводятся соответствующие статьи, иначе все
     if (isset($param['category'])) {
         $cat = $this->clear_int($param['category']);
         if ($cat) {
             $this->page_array = $pager->get_navigation($cat);
             $start = $pager->start($cat);
             //             print_r($pager->get_article($start,$cat));
             //             $this->articles = $this->ob_model->get_article($cat,false);
             $this->articles = $pager->get_article($start, $cat);
         }
     } else {
         $this->page_array = $pager->get_navigation(false);
         $start = $pager->start(false);
         //         print_r($pager->get_article($start));
         //         $this->articles = $this->ob_model->get_article(false);
         $this->articles = $pager->get_article($start, false);
     }
     $this->page = $this->render(TEMPLATE . 'inc/page', array('page_array' => $this->page_array));
 }
 public function input($param = array())
 {
     parent::input();
     if ($param['page']) {
         $page = $this->clear_int($param['page']);
         if ($page == 0) {
             $page = 1;
         }
     } else {
         $page = 1;
     }
     $this->title .= "Նորությունների արխիվ";
     $this->keywords = "Արմ-Շին, Էներգո, Նորություններ";
     $this->discription = "Արմ-Շին Էներգո Կայքի Նորությունների արխիվ";
     $pager = new Pager($page, 'news', array(), 'news_date', 'DESC', QUANTITY, QUANTITY_LINKS);
     $this->archive = $pager->get_posts();
     $this->navigation = $pager->get_navigation();
     //echo "<pre>";
     //print_r($this->archive);
     //print_r($this->navigation);
     //echo "</pre>";
     //echo $page;
 }