diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index 56d7b627..bcce6c28 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -68,7 +68,22 @@ 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 ts_published<'$time' LIMIT 8"; + $sth = $this->db->query($sql); + $rows = $sth->fetchAll(PDO::FETCH_BOTH); + + foreach($rows as $k=>$v) + { + $url = $News->getArchiveUrlByCid($v['id']); + $rows[$k]['url'] = $url['archive_url']; + $rows[$k]['type_title'] = $url['type_title']; + $rows[$k]['type_url'] = $url['type_url']; + } + + $this->view->list_news = $rows; + } } diff --git a/application/default/views/scripts/index/index.phtml b/application/default/views/scripts/index/index.phtml index 8c6281dd..a073780e 100755 --- a/application/default/views/scripts/index/index.phtml +++ b/application/default/views/scripts/index/index.phtml @@ -123,28 +123,16 @@