diff --git a/application/default/controllers/NewsController.php b/application/default/controllers/NewsController.php deleted file mode 100644 index 20ffde1e..00000000 --- a/application/default/controllers/NewsController.php +++ /dev/null @@ -1,150 +0,0 @@ -view->config = Zend_Registry::get('config'); - $this->db=Zend_Registry::get('db'); - } - - function indexAction() - { - $News = new Archive($this->db); - $category = new ArchiveCategory($this->db); - $this->view->types = $category->GetCategory(); - $this->view->deepField = $category->DeepTitle; - - $time = date("Y-m-d H:i:s",time()); - - $sql = "SELECT id,title,code FROM ".$News->tbl_categorys." where ptype='news'"; - $sth = $this->db->query($sql); - $rows = $sth->fetchAll(); - - $newslist = array(); - - foreach($rows as $v) - { - $sql = "SELECT n.*,c.title as typetitle,c.code FROM ".$News->tbl_archives." n - left join ".$News->tbl_catalog." ct on ct.aid=n.id - left join ".$News->tbl_categorys." c on c.id = ct.cid - WHERE n.ts_published<'$time' AND ct.cid={$v['id']} - ORDER BY ts_published DESC - LIMIT 10"; - - $rs = $this->db->query($sql); - $archives = $rs->fetchAll(); - - $newslist[$v['id']] = array("title"=>$v['title'],"code"=>$v['code'],"id"=>$v['id'],"list"=>$archives); - } - $this->view->lists = $newslist; - - - } - - function listAction() - { - $type = strtolower($this->_request->getParam('type')); - $page = $this->_request->getParam('page'); - - if(preg_match("/archive\-(\d+)\.html/",$page,$matches)) - { - $this->_forward('archive', 'news', null, array('archive' => $matches['1'] , 'type'=> $type)); - } - else - { - if(preg_match("/[^a-z0-9]/",$type) || preg_match("/[^0-9]/",$page)) - { - $this->_forward('error', 'error', null, null); - } - - - $News = new Archive($this->db); - - $sql = "SELECT id,code,title FROM ".$News->tbl_categorys." WHERE code='$type' AND is_pub=true "; - $rs = $this->db->query($sql); - $row = $rs->fetch(); - - if(empty($row['id'])) - { - $this->_forward('error', 'error', null, null); - } - - else{ - - $this->view->url = $row['code']; - $this->view->title = $row['title']; - - $category = new ArchiveCategory($this->db); - $this->view->types = $category->GetCategory(); - $this->view->deepField = $category->DeepTitle; - - $time = date("Y-m-d H:i:s",time()); - - $sql = "SELECT n.*,c.code FROM ".$News->tbl_archives." n - left join ".$News->tbl_catalog." ct on ct.aid=n.id - left join ".$News->tbl_categorys." c ON ct.cid=c.id - WHERE c.id='{$row['id']}' AND n.ts_published<'".$time."' AND n.is_pub=true - ORDER BY n.ts_published DESC"; - - $rs = $this->db->query($sql); - $rows = $rs->fetchAll(); - - $paginator = Zend_Paginator::factory($rows); - $paginator->setCurrentPageNumber($page); - $paginator->setItemCountPerPage($this->view->config->page->max); - $paginator->setView($this->view); - Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); - $this->view->paginator=$paginator; - - } - } - - } - - function archiveAction() - { - $type = $this->_request->getParam('type'); - $archive = $this->_request->getParam('archive'); - - $this->view->type = $type; - - if(preg_match("/[^a-z0-9]/",$type) || preg_match("/[^0-9]/",$archive)) - { - $this->_forward('error', 'error', null, null); - } - - $News = new Archive($this->db); - $category = new ArchiveCategory($this->db); - $this->view->types = $category->GetCategory(); - $this->view->deepField = $category->DeepTitle; - - $time = date("Y-m-d",time()); - - $sql = "SELECT n.*,c.title as typename,c.code,u.realname as author FROM ".$News->tbl_archives." n - left join ".$News->tbl_catalog." ct on ct.aid=n.id - left join ".$News->tbl_categorys." c ON ct.cid=c.id - LEFT JOIN users u ON n.userid=u.id - WHERE c.code='".$type."' AND n.ts_published<'".$time."' AND n.is_pub=true AND n.id=".$archive." - ORDER BY n.ts_published DESC"; - - $rs = $this->db->query($sql); - $row = $rs->fetch(); - - if(empty($row['id'])) - { - $this->_forward('error', 'error', null, null); - } - - $this->view->infos = $row; - - } - - function searchAction() - { - - } - -} \ No newline at end of file diff --git a/application/default/views/scripts/news/archive.phtml b/application/default/views/scripts/news/archive.phtml deleted file mode 100644 index 6e02cde1..00000000 --- a/application/default/views/scripts/news/archive.phtml +++ /dev/null @@ -1,57 +0,0 @@ -headTitle($config->title->site); -$this->headTitle($this->infos['title']); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/news.css'); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); -$this->breadcrumb('首页'); -$this->breadcrumb('新闻中心'); -$this->breadcrumb(''.$this->infos['typename'].''); -$this->breadcrumb($this->infos['title']); -$this->breadcrumb()->setSeparator(' > '); -if(!empty($this->infos['keyword'])) $keyword = $this->infos['keyword']; else $keyword = $this->infos['title']; -$this->headMeta()->appendName('keywords', $keyword); -$this->headMeta()->appendName('description', mb_substr($this->infos['description'],0,180,'utf-8')); -?> -
-
-
-
栏目导航
- -
-
-
- -
infos['title'];?>
-
时间 : infos['ts_published']));?>  作者 : infos['author'];?>  来源 : infos['source'];?>
-
- - - - -
- infos['body'];?> -
-
-
-
- \ No newline at end of file diff --git a/application/default/views/scripts/news/index.phtml b/application/default/views/scripts/news/index.phtml deleted file mode 100644 index d249f85d..00000000 --- a/application/default/views/scripts/news/index.phtml +++ /dev/null @@ -1,55 +0,0 @@ -headTitle($this->config->title->site); -$this->headTitle('新闻中心'); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/news.css'); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); -$this->breadcrumb('首页'); -$this->breadcrumb('新闻中心'); -$this->breadcrumb()->setSeparator(' > '); -?> -
-
-
-
新闻分类
- -
-
-
- lists as $v) - {?> - 0) {?> -
-
-
-
    - -
  • - -
-
-
- -
-
- \ No newline at end of file diff --git a/application/default/views/scripts/news/list.phtml b/application/default/views/scripts/news/list.phtml deleted file mode 100644 index 7444cc1c..00000000 --- a/application/default/views/scripts/news/list.phtml +++ /dev/null @@ -1,75 +0,0 @@ -headTitle($this->config->title->site); -$this->headTitle('新闻中心'); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/news.css'); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); -$this->breadcrumb('首页'); -$this->breadcrumb('新闻中心'); -$this->breadcrumb($this->title); -$this->breadcrumb()->setSeparator(' > '); -?> -
-
-
-
新闻分类
- -
-
-
-
-
    - paginator)) - { - foreach ($this->paginator as $v) - { - $description = ""; - if(empty($v['description'])) - { - $description = "No description"; - }else if (mb_strlen($v['description'])>160) - { - $description = mb_substr($v['description'],0,160,'utf-8').'...(more)'; - }else{ - $description = $v['description']; - } - echo '
  • '; - if(!empty($v['image'])) - { - echo ''; - } - echo ''.$v['title'].'
    - TIME : '.date("Y-m-d H:i",strtotime( $v['ts_published'] )).' -

    '.$description.'

    -
  • '; - } - } - else - { - echo '暂无数据'; - } - ?> -
-
- -
-
- \ No newline at end of file diff --git a/application/default/views/scripts/news/search.phtml b/application/default/views/scripts/news/search.phtml deleted file mode 100644 index ad2852c0..00000000 --- a/application/default/views/scripts/news/search.phtml +++ /dev/null @@ -1,11 +0,0 @@ -headTitle($config->title->site); -$this->headTitle($config->title->review); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/news.css'); -$this->headScript()->appendFile('/js/jquery-1.7.min.js'); -$this->breadcrumb('Home'); -$this->breadcrumb('News'); -$this->breadcrumb()->setSeparator(' > '); -?> \ No newline at end of file