diff --git a/application/default/controllers/HiwaterController.php b/application/default/controllers/HiwaterController.php index 2d27245c..e01ead85 100644 --- a/application/default/controllers/HiwaterController.php +++ b/application/default/controllers/HiwaterController.php @@ -276,12 +276,13 @@ class HiwaterController extends DataController function tagAction() { $key = $this->_request->getParam('key'); + $keytype = $this->_request->getParam('keytype'); $page=(int)$this->_request->getParam('page'); if (empty($page)) $page=1; $offset=$this->limit*($page-1); if (!empty($key)) { $this->view->codename=$key; - $sql=$this->db->quoteInto('select count(id) from keyword where keyword=?',$key); + $sql=$this->db->quoteInto("select count(k.id) from keyword k left join normalmetadata m on k.id=m.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') and k.keyword=?",$key); $state=$this->db->query($sql); $row=$state->fetchAll(); $sum=$row[0]['count']; @@ -289,17 +290,12 @@ class HiwaterController extends DataController $this->view->metadata=$this->db->fetchAll($sql,array($this->limit,$offset)); $this->view->page=new Pagination($sum,$page,$this->limit); } else { - $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='place' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by keyword.keyword order by count desc"); - $k1=$state->fetchAll(); - $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='theme' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by k.keyword order by k.keyword"); - $k2=$state->fetchAll(); - $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='discipline' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by k.keyword order by k.keyword"); - $k3=$state->fetchAll(); - $state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join normalmetadata m on k.id=m.id where k.keytype='stratum' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by k.keyword order by k.keyword"); - $k4=$state->fetchAll(); - $state=$this->db->query("select keyword.keyword,count(*) from keyword left join normalmetadata m on keyword.id=m.id where keyword.keytype='temporal' and m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') group by keyword.keyword order by keyword.keyword"); - $k5=$state->fetchAll(); - $this->view->keywords=array('place'=>$k1,'theme'=>$k2,'discipline'=>$k3,'stratum'=>$k4,'temporal'=>$k5); + $sql="select k.keyword,count(*),k.keytype from keyword k left join normalmetadata m on k.id=m.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') "; + if (!empty($keytype) && ($keytype=='place' || $keytype=='theme' || $keytype=='discipline'||$keytype=='temporal')) $sql.=" and k.keytype='".$keytype."'"; + $sql.=' group by k.keyword,k.keytype order by k.keytype,k.keyword,count desc'; + $state=$this->db->query($sql); + $this->view->keytype=$keytype; + $this->view->keywords=$state->fetchAll(); } } @@ -334,7 +330,7 @@ class HiwaterController extends DataController function timelineAction() { - $fn="heihetime.xml"; + $fn="hiwatertime.xml"; $rows=$this->db->fetchAll("select ts_created from normalmetadata where uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='hiwater') order by ts_created desc limit 1"); $last_update=strtotime($rows[0]['ts_created']); if (!file_exists($fn) || (filemtime($fn)<$last_update)) @@ -379,6 +375,12 @@ class HiwaterController extends DataController //提供全部分类列表 } } + + function viewAction() + { + parent::viewAction(); + $this->_helper->viewRenderer('hiwater/view'); + } private function getmd($keyword,$type='theme') { diff --git a/application/default/views/scripts/hiwater/base.phtml b/application/default/views/scripts/hiwater/base.phtml index 58cc53e7..af2309cc 100644 --- a/application/default/views/scripts/hiwater/base.phtml +++ b/application/default/views/scripts/hiwater/base.phtml @@ -3,7 +3,7 @@ $this->headTitle($this->config->title->site); $this->headTitle($this->config->title->data); $this->headTitle()->setSeparator(' - '); $this->headLink()->appendStylesheet('/css/water.css'); -$this->nav[] = array('link'=>"/water",'title'=>'黑河生态水文遥感试验'); +$this->nav[] = array('link'=>"/hiwater",'title'=>'黑河生态水文遥感试验'); ?> = $this->render('breadcrumbs.phtml'); ?>
datadoi) || !strpos($md->citation,$md->datadoi)) : ?>文章的引用 + escape($md->citation);if (strpos($md->citation,$md->datadoi)) : ?> + (下载引用:RIS格式 | RIS英文格式 | Bibtex格式 | Bibtex英文格式) + +
+ datadoi) && !strpos($md->citation,$md->datadoi)) : ?> +数据的引用authors,1,-1).'. '.$md->title.'. '.$md->publisher.', '.(empty($md->ts_published)?$md->publish_year:date('Y',strtotime($md->ts_published))).'. doi:'.$md->doi; + echo ' ['.str_replace('"','',substr($md->author_en,1,-1)).'. '.$md->title_en.'. '.$md->publisher_en.', '.$md->publish_year.'. doi:'.$md->doi.']'; + ?> (下载引用:RIS格式 | RIS英文格式 | Bibtex格式 | Bibtex英文格式)
+ ref) : ?> +'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit->uselimit)).'
'; + endforeach; + ?> + +为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
+中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
+英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
+ + + data_archives){ ?> +',$this->escape($md->suppinfo)).'
';?> + +最近10条服务记录如下:
+-
',$md->description);?> -
-escape($md->citation);?>
- -ref) : ?> -'.str_replace(array("\r\n", "\n", "\r"),'
',$this->escape($uselimit->uselimit)).'
'; -endforeach; -?> - -为尊重知识产权、保障数据作者的权益、扩展数据中心的服务、评估数据的应用潜力,请数据使用者在使用数据所产生的研究成果中(包括公开发表的论文、论著、数据产品和未公开发表的研究报告、数据产品等成果),明确注明数据来源和数据作者。对于转载(二次或多次发布)的数据,作者还须注明原始数据来源。
-中文发表的成果参考以下规范注明: 数据来源于国家自然科学基金委员会"中国西部环境与生态科学数据中心"(http://westdc.westgis.ac.cn)
-英文发表的成果依据以下规范注明: The data set is provided by Environmental and Ecological Science Data Center for West China,National Natural Science Foundation of China (http://westdc.westgis.ac.cn)
- - -suppinfo) : ?> -',$this->escape($md->suppinfo)).'
';?> - -data_archives){ ?> -最近10条服务记录如下:
-没有找到对应的元数据。
此数据还在评审过程中,我们真切地邀请您参加此数据的评审,以便我们能尽快发布此数据!评审
+ +数据评论
+