From 0dee17f92b48f139a1503a2b947b1cd9a7da9b6f Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 12 Jun 2014 03:25:06 +0000 Subject: [PATCH] change index page --- application/default/controllers/IndexController.php | 7 +++++-- application/default/views/scripts/index/index.phtml | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index e395d60a..8c0b2d4a 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -50,7 +50,8 @@ 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->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"; + $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); @@ -63,7 +64,9 @@ 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->subnews' AND ts_publisheddb->query($sql); $rows = $sth->fetchAll(PDO::FETCH_BOTH); diff --git a/application/default/views/scripts/index/index.phtml b/application/default/views/scripts/index/index.phtml index 19c9d7fb..19f6ccf0 100755 --- a/application/default/views/scripts/index/index.phtml +++ b/application/default/views/scripts/index/index.phtml @@ -2,12 +2,10 @@ $this->headTitle($this->config->title->site); $this->headTitle('首页'); $this->headTitle()->setSeparator(' - '); - $auth = Zend_Auth::getInstance(); - ?> - + @@ -22,7 +20,7 @@ 23 ? mb_substr($v['title'],0,23,'utf-8')."...":$v['title'] ?> - 更多>> + 更多>> @@ -36,7 +34,7 @@ - 更多>> + 更多>>