change news config

This commit is contained in:
wlx 2014-06-12 03:16:05 +00:00
parent 4bf466aa58
commit b6d34f1b43
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@ class IndexController extends Zend_Controller_Action
$this->db=Zend_Registry::get('db');
$this->view->theme = new Theme();
$this->submd = $this->view->config->sub->metadata;
$this->subnews = $this->view->config->sub->metadata;
$this->_helper->layout->setLayout('index');
//$this->view->main_nav_pageID = "index";
}
@ -49,7 +50,7 @@ class IndexController extends Zend_Controller_Action
$News = new Archive($this->db);
$time = date("Y-m-d H:i:s",time());
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->submd' AND ts_published<'$time' AND image!='' and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='featured') order by ts_published desc LIMIT 5";
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<'$time' AND image!='' and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='featured') order by ts_published desc LIMIT 5";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
@ -62,7 +63,7 @@ class IndexController extends Zend_Controller_Action
$this->view->news = $rows;
//$time = date("Y-m-d H:i:s",time());
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->submd' AND ts_published<now() and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news') order by ts_published desc LIMIT 12 ";
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<now() and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news') order by ts_published desc LIMIT 12 ";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);