From 00ba57a340f02f8399a1b78f8e6738cd1578e1e0 Mon Sep 17 00:00:00 2001 From: wlx Date: Wed, 28 May 2014 03:29:19 +0000 Subject: [PATCH] remove unused code --- .../default/controllers/DataController.php | 33 ------------------- .../default/controllers/IndexController.php | 18 +--------- 2 files changed, 1 insertion(+), 50 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 357d12ef..7d9cf4fe 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -46,40 +46,7 @@ class DataController extends Zend_Controller_Action //最新10个入库数据 $state=$this->db->query('select id,uuid,title from normalmetadata order by id desc limit 10'); $this->view->metadata = $state->fetchAll(); - //特色数据 - //服务 - $l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf"); - $this->view->newsletter=$l->getLast(); - $name=basename($this->view->newsletter,'.pdf'); - list(,$this->view->newsletterno)=explode("_",$name); - - $this->view->addHelperPath('helper','Zend_View_Helper_'); - $form=new MaillistForm(); - $form->submit->setLabel('输入邮件地址,订阅数据通讯列表'); - - $this->view->form=$form; - if ($this->_request->isPost()) { - //发送邮件 - $formData=$this->_request->getPost(); - if ($form->isValid($formData)) { - $mail=new WestdcMailer($this->view->config->smtp); - $mail->setFrom($formData['email']); - $mail->setBodyText("."); - $mail->setSubject('subscribe'); - $mail->addTo($this->view->config->reportemail); - $mail->send(); - $this->messenger->addMessage('订阅成功,请检查您的邮件!'); - $this->_redirect('/data/'); - } - } else { - $auth = Zend_Auth::getInstance(); - if ($auth->hasIdentity()) { - $user=$auth->getIdentity(); - $formData['email']=$user->email; - $form->populate($formData); - } - } $searchform=new SearchForm(); $this->view->searchform=$searchform; diff --git a/application/default/controllers/IndexController.php b/application/default/controllers/IndexController.php index b67ac8f9..9620e27e 100755 --- a/application/default/controllers/IndexController.php +++ b/application/default/controllers/IndexController.php @@ -12,11 +12,6 @@ class IndexController extends Zend_Controller_Action function indexAction() { - //数据通讯 - $l=new mydir($this->view->config->paths->newsletter,"newsletter_*.pdf"); - $this->view->newsletter=$l->getLast(); - $name=basename($this->view->newsletter,'.pdf'); - list(,$this->view->newsletterno)=explode("_",$name); //统计数据 $sql='select (select count(*) from users) as usernum,(select count(*) from normalmetadata) as metanum,(select count(*) from offlineapp where ts_approved is not null ) as offlinenum'; $row=$this->db->fetchRow($sql); @@ -35,12 +30,6 @@ class IndexController extends Zend_Controller_Action else $this->view->onlinesize=$row['sum']; } - //特色推荐 - $sql="select * from datafeature order by id desc"; - $this->view->feature=$this->db->fetchRow($sql); - //特色数据集 - $sql="select * from datasetcd order by random()"; - $this->view->datasetcd=$this->db->fetchRow($sql); //下载最多数据(top 5) $sql="select uuid,title,id from normalmetadata where id in (select m.id from normalmetadata m left join dataorder d on m.uuid=d.uuid where m.datatype=0 group by m.id order by count(d.uuid) desc limit 5)"; $this->db->setFetchMode(Zend_Db::FETCH_OBJ); @@ -83,12 +72,7 @@ class IndexController extends Zend_Controller_Action $rows[$k]['type_url'] = $url['type_url']; } - $this->view->list_news = $rows; - - $sql="select d.*,m.ts_published as publish_year from datadoi d right join normalmetadata m on d.uuid=m.uuid where d.ts_published is not null order by ts_published desc limit 4"; - $sth = $this->db->query($sql); - $this->view->dois = $sth->fetchAll(); - + $this->view->list_news = $rows; } }