From b6d34f1b434c69319d526e772321362014a323df Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 12 Jun 2014 03:16:05 +0000 Subject: [PATCH] change news config --- application/default/controllers/IndexController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index d2e1ed88..e395d60a 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -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_publisheddb->query($sql); $rows = $sth->fetchAll(PDO::FETCH_BOTH);