Ejemplo n.º 1
0
 private function show()
 {
     $this->_tpl->assign('show', true);
     $this->_tpl->assign('title', 'Article List');
     $this->nav();
     $_nav = new NavModel();
     if (empty($_GET['nav'])) {
         $_id = $_nav->getAllNavChildId();
         $this->_model->nav = Tool::objArrOfStr($_id, 'id');
     } else {
         $_nav->id = $_GET['nav'];
         if (!$_nav->getOneNav()) {
             Tool::alertBack('nav not existing');
         }
         $this->_model->nav = $_nav->id;
     }
     parent::page($this->_model->getListContentTotal());
     $_object = $this->_model->getListContent();
     Tool::subStr($_object, 'title', 20, null);
     $this->_tpl->assign('SearchContent', $_object);
 }
Ejemplo n.º 2
0
 private function getListContent()
 {
     if (isset($_GET['id'])) {
         parent::__construct($this->_tpl, new ContentModel());
         $_nav = new NavModel();
         $_nav->id = $_GET['id'];
         $_navid = $_nav->getNavChildId();
         if ($_navid) {
             $this->_model->nav = Tool::objArrOfStr($_navid, 'id');
         } else {
             $this->_model->nav = $_nav->id;
         }
         parent::page($this->_model->getListContentTotal(), ARTICLE_SIZE);
         $_object = $this->_model->getListContent();
         Tool::subStr($_object, 'info', 120, 'utf-8');
         Tool::subStr($_object, 'title', 35, 'utf-8');
         if ($_object) {
             foreach ($_object as $_value) {
                 if (empty($_value->thumbnail)) {
                     $_value->thumbnail = 'images/none.jpg';
                 }
             }
         }
         $this->_tpl->assign('AllListContent', $_object);
         $_object = $this->_model->getMonthNavRec();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavRec', $_object);
         $_object = $this->_model->getMonthNavHot();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavHot', $_object);
         $_object = $this->_model->getMonthNavPic();
         $this->setObject($_object);
         $this->_tpl->assign('MonthNavPic', $_object);
     } else {
         Tool::alertBack('警告:非法操作!');
     }
 }