From 7d07e31ec74cf1c4725b031f4bef7f0efedce33d Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 12 Apr 2012 08:21:00 +0000 Subject: [PATCH] merge trunk to r2219. --- .../admin/controllers/DataController.php | 302 +++++------------- .../admin/controllers/NewsController.php | 296 +++++++++++++---- .../admin/controllers/WatermdController.php | 2 +- .../views/scripts/news/category-add.phtml | 60 ++++ .../admin/views/scripts/news/catlog.phtml | 158 ++++----- .../admin/views/scripts/news/catlogadd.phtml | 78 ----- .../admin/views/scripts/news/index.phtml | 165 +++++----- .../admin/views/scripts/news/left.phtml | 40 +-- .../admin/views/scripts/news/newsadd.phtml | 115 ++++--- .../admin/views/scripts/news/newsaddok.phtml | 117 ++----- .../admin/views/scripts/news/newsedit.phtml | 224 +++++++++++++ .../admin/views/scripts/news/newslist.phtml | 238 +++++++------- .../views/scripts/sys/emailtexthelp.phtml | 24 ++ .../default/controllers/AboutController.php | 18 ++ .../default/controllers/DataController.php | 31 +- .../default/controllers/NewsController.php | 135 ++++++++ .../default/controllers/ServiceController.php | 55 +++- .../views/scripts/about/background.phtml | 16 +- .../default/views/scripts/about/contact.phtml | 11 +- .../views/scripts/about/copyright.phtml | 21 ++ .../default/views/scripts/about/honor.phtml | 22 ++ .../default/views/scripts/about/index.phtml | 6 +- .../default/views/scripts/about/legal.phtml | 58 ++++ .../default/views/scripts/about/link.phtml | 20 ++ .../default/views/scripts/about/navi.phtml | 11 + .../views/scripts/about/sponsors.phtml | 22 ++ .../views/scripts/about/supportus.phtml | 22 ++ .../views/scripts/author/accept-active.phtml | 27 ++ .../default/views/scripts/author/accept.phtml | 86 +++++ .../default/views/scripts/author/apply.phtml | 99 ++++++ .../views/scripts/author/authored-list.phtml | 48 +++ .../scripts/author/authored-listall.phtml | 49 +++ .../views/scripts/author/authored.phtml | 48 +++ .../default/views/scripts/author/help.phtml | 27 ++ .../scripts/author/inauthor-offline.phtml | 83 +++++ .../views/scripts/author/inauthor.phtml | 59 ++++ .../default/views/scripts/author/index.phtml | 53 +++ .../default/views/scripts/author/navi.phtml | 26 ++ .../default/views/scripts/data/thumb.phtml | 36 +++ .../default/views/scripts/news/archive.phtml | 54 ++++ .../default/views/scripts/news/index.phtml | 67 ++++ .../default/views/scripts/news/list.phtml | 68 ++++ .../default/views/scripts/news/search.phtml | 11 + .../models/CustomControllerAclManager.php | 8 +- application/models/EmailText.php | 38 ++- application/models/ISO19115.php | 150 ++++++++- application/models/ImgCode.php | 176 ++++++++++ application/models/LoginForm.php | 132 +++++--- application/models/Proftp.php | 9 +- application/models/member.php | 1 + 50 files changed, 2690 insertions(+), 932 deletions(-) create mode 100644 application/admin/views/scripts/news/category-add.phtml delete mode 100644 application/admin/views/scripts/news/catlogadd.phtml create mode 100644 application/admin/views/scripts/news/newsedit.phtml create mode 100644 application/default/controllers/NewsController.php create mode 100644 application/default/views/scripts/about/copyright.phtml create mode 100644 application/default/views/scripts/about/honor.phtml create mode 100644 application/default/views/scripts/about/legal.phtml create mode 100644 application/default/views/scripts/about/link.phtml create mode 100644 application/default/views/scripts/about/navi.phtml create mode 100644 application/default/views/scripts/about/sponsors.phtml create mode 100644 application/default/views/scripts/about/supportus.phtml create mode 100644 application/default/views/scripts/author/accept-active.phtml create mode 100644 application/default/views/scripts/author/accept.phtml create mode 100644 application/default/views/scripts/author/apply.phtml create mode 100644 application/default/views/scripts/author/authored-list.phtml create mode 100644 application/default/views/scripts/author/authored-listall.phtml create mode 100644 application/default/views/scripts/author/authored.phtml create mode 100644 application/default/views/scripts/author/help.phtml create mode 100644 application/default/views/scripts/author/inauthor-offline.phtml create mode 100644 application/default/views/scripts/author/inauthor.phtml create mode 100755 application/default/views/scripts/author/index.phtml create mode 100644 application/default/views/scripts/author/navi.phtml create mode 100644 application/default/views/scripts/data/thumb.phtml create mode 100644 application/default/views/scripts/news/archive.phtml create mode 100644 application/default/views/scripts/news/index.phtml create mode 100644 application/default/views/scripts/news/list.phtml create mode 100644 application/default/views/scripts/news/search.phtml create mode 100644 application/models/ImgCode.php diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 298f07d6..79b5a2ce 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -30,7 +30,7 @@ class Admin_DataController extends Zend_Controller_Action $thumb=$this->_request->getParam('thumb'); $list=$this->_request->getParam('list'); $adminuser=$this->_request->getParam('adminuser'); - $uuid=$this->_request->getParam('uuid'); + $uuid=trim($this->_request->getParam('uuid')); if ($this->_request->isPost()) $uuid=$this->_request->getPost('uuid'); //$uuid=$this->_request->getParam('uuid'); if ($source=="geonetwork" && empty($uuid) ) { @@ -332,42 +332,77 @@ class Admin_DataController extends Zend_Controller_Action }//编辑附件 + /* + * 输出打包下载的xml文件 + * + * 文件量大时可能出现超时,需要修改超时时间为无限 + */ elseif ($down) { - $zip = new ZipArchive(); - $url="/tmp/xml.zip"; - $opened=$zip->open($url, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE); - if( $opened !== true ){ - die("cannot open {$url} for writing."); - } + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + //临时zip文件名 + $tmpname="dataxml"; + + //xml文件存放的缓存目录 $dirName = '../data/import/'; - $zip->addEmptyDir("xml/"); - - $filesToAdd = array(); - $dir = dir($dirName); - while (false !== ($node = $dir->read())) { - if (($node == '..') || ($node == '.')) { - continue; - } - if (is_file($dirName.$node)) { - $zip->addFile($dirName.$node,"xml/".$node); - } - } - $zip->close(); - $content=file_get_contents($url); - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); + + //查询需要创建的文件 + $sql = "SELECT md.title,md.uuid,x.* from xml x + LEFT JOIN normalmetadata md ON md.id=x.id"; + + $sth = $this->db->prepare($sql); + $sth->execute(); + $rows = $sth->fetchAll(); //将结果储存,但不使用 + + //创建zip文件,创建成功后再使用查询结果 + $zip = new ZipArchive(); + $url = tempnam($this->config->temp->path,$tmpname);//创建临时文件 + + if( $zip->open($url, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE) !== true ) + { + throw new Exception("cannot open {$url} for writing."); + } + + foreach($rows as $k=>$v) + { + + $filename = $dirName.$v['uuid'].'.xml'; + + //创建xml文件 + $handle = fopen($filename,"w"); + fwrite($handle,$v['data']); + fclose($handle); + + //添加到zip文件 + //zip localname 直接使用UUID作为文件名 + $zip->addFile($filename,$v['uuid'].".xml"); + + } + $zip->close(); + + //zip文件创建完成后删除服务器上的缓存文件,防止发生冗余 + foreach($rows as $k=>$v) + { + $filename = $dirName.$v['uuid'].'.xml'; + unlink($filename); + } + + //输出下载 + $content=file_get_contents($url); $this->getResponse()->setHeader('Content-Type', 'application/octet-stream') - ->setHeader('Content-Disposition','attachment; filename="'.basename($url).'"') - ->setHeader('Content-Length', strlen($content)) - ->setHeader('Content-Type','application/force-download') - ->setHeader('Content-Type','application/download') - ->setHeader('Content-Type','application/zip') - ->setHeader('Content-Description','File Transfer') - ->setHeader('Content-Transfer-Encoding','binary') - ->setHeader('Expires',0) - ->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0') - ->setHeader('Pragma','public') - ->setBody($content); + ->setHeader('Content-Disposition','attachment; filename="dataxml.zip"') + ->setHeader('Content-Length', strlen($content)) + ->setHeader('Content-Type','application/force-download') + ->setHeader('Content-Type','application/download') + ->setHeader('Content-Type','application/zip') + ->setHeader('Content-Description','File Transfer') + ->setHeader('Content-Transfer-Encoding','binary') + ->setHeader('Expires',0) + ->setHeader('Cache-Control','must-revalidate, post-check=0, pre-check=0') + ->setHeader('Pragma','public') + ->setBody($content); }//down else if($search){ @@ -685,7 +720,12 @@ class Admin_DataController extends Zend_Controller_Action foreach($lines as $line) { $data=explode(";",$line); - $sql="insert into reference (reference) values(?)"; + if (count($data)==2) + $link=''; + else + $link=$data[2]; + $link=$this->db->quote($link); + $sql="insert into reference (reference,link) values(?,".$link.")"; try { $this->db->exec($this->db->quoteInto($sql,$data[1])); } catch (Exception $e) {} @@ -1117,7 +1157,7 @@ class Admin_DataController extends Zend_Controller_Action }// 清除元数据来源记录 - elseif ($do=='sync') { //同步数据来源到metadata表 + elseif ($do=='sync') { //同步数据来源到metadata表 $redirect = "/admin/data/source/"; $sql = "update metadata m set source=s.uuid from source s right join datasource d on s.id=d.sourceid where m.uuid=d.uuid"; if($this->db->exec($sql)) @@ -1496,195 +1536,7 @@ class Admin_DataController extends Zend_Controller_Action private function import($xml) { $iso=new ISO19115(); - $iso->loadXML($xml); - $md=new MetadataTable(); - $thumb=new ThumbnailTable(); - $xmlt=new XmlTable(); - $cgt=new CategoryTable(); - $cgct=new CategoryCodeTable(); - $keyt=new KeywordTable(); - $dst=new DatasetSeriesTable(); - $seriestable=new SeriesTable(); - $db=$seriestable->getAdapter(); - //save metadata - //先删除已有元数据,然后再插入新数据 - $sql="delete from metadata where uuid=?"; - $this->db->query($sql,array($iso->uuid)); - //删除所有未用到的responsible数据 - $sql="delete from responsible where id not in (select distinct(resid) from role)"; - $this->db->query($sql); - $row=$md->createRow(); - $trow=$thumb->createRow(); - $row->uuid=$iso->uuid; - $row->title=$iso->resTitle; - $row->title_en=$iso->resAltTitle; - $row->description=$iso->idAbs; - $row->citation=$iso->citation; - $row->suppinfo=$iso->suppinfo; - $row->fileformat=$iso->fileformat; - $row->projection=$iso->projection; - //$row->author=$iso->author; - $row->datatype=$iso->datatype; - $row->filesize=$iso->filesize; - $row->ts_created=$iso->mdDateSt; - $row->timebegin=$iso->timebegin; - $row->timeend=$iso->timeend; - $row->west=$iso->geoBox['w']; - $row->south=$iso->geoBox['s']; - $row->north=$iso->geoBox['n']; - $row->east=$iso->geoBox['e']; - if (!empty($iso->doi)) $row->doi=$iso->doi; - //生成空白统计数据 - $sql=$db->quoteInto("select * from mdstat where uuid=?",$iso->uuid); - if (!$db->fetchRow($sql)) - { - $sql="insert into mdstat (uuid) values(?)"; - $db->query($sql,array($iso->uuid)); - } - try { - $id=$row->save(); - //处理在线资源 - if ($iso->onlineresource) foreach($iso->onlineresource as $resource) - { - $sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; - $db->query($sql,array($iso->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); - } - //处理缩略图 - if (!empty($iso->thumbnail)) { - $trow->id=$id; - $trow->data=$iso->thumbnail; - $trow->filetype='jpg'; - $trow->save(); - } elseif ($iso->graph) { - $trow->id=$id; - //$trow->data=$iso->graph['data']; - $sql="select id as gid from geonetworkmetadata where uuid=?"; - $r=$this->db->fetchRow($sql,array($iso->uuid)); - if ($r) - { - $trow->data=base64_encode(file_get_contents($this->view->config->geonetwork->url.'srv/cn/resources.get?access=public&id='.$r->gid.'&fname='.urlencode($iso->graph['filename']))); - } - $trow->filetype=$iso->graph['filetype']; - $trow->filedesc=$iso->graph['filedesc']; - $trow->filename=$iso->graph['filename']; - $trow->save(); - } - //todo:处理关键词 - //1:N relation - foreach($iso->keyword as $keytype=>$keys) - { - foreach($keys as $key) - { - $row=$keyt->createRow(); - $row->id=$id; - //统一转换为大写 - //不再统一转换 - $row->keyword=$key; - $row->keytype=$keytype; - $row->save(); - } - } - //todo:处理数据集序列 - //M:N relation - if ($iso->datasetSeries) foreach($iso->datasetSeries as $ds) - { - $where=$db->quoteInto('name = ?',$ds['seriesName']); - $trow=$seriestable->fetchRow($where); - if ($trow) - $sid=$trow->id; - else { - $trow=$seriestable->createRow(); - $trow->name=$ds['seriesName']; - $sid=$trow->save(); - } - $row=$dst->createRow(); - $row->id=$id; - $row->sid=$sid; - $row->save(); - } - //处理XML入库 - $row=$xmlt->createRow(); - $row->id=$id; - $row->data=$xml; - $row->save(); - //处理数据分类 - foreach($iso->tpCat as $cat){ - if (is_numeric($cat)) { - $row=$cgt->createRow(); - $row->id=$id; - $row->code=(int)$cat; - $row->save(); - } else { - //是字符串,geonetwork会采用这种模式 - //从categorycode表中查找其对应的code - $where=$db->quoteInto('name= ?',trim($cat)); - $trow=$cgct->fetchRow($where); - if ($trow) { - $row=$cgt->createRow(); - $row->id=$id; - $row->code=$trow->code; - $row->save(); - } - //$db=$cgt->getAdapter(); - //$sql="insert into category (id,code) values($id,(select code from categorycode where name='$cat'))"; - //$db->query($sql); - } - } - //处理联系人信息 - //先查询再进行处理 - //若用户信息发生变化,则存在问题 - //无法保证数据的更新状态 - foreach($iso->author as $au) - { - $inds=explode(",",$au['individual']); - foreach($inds as $ind) - { - $sql="select id from responsible where individual=? and organisation=?"; - $row=$this->db->fetchRow($sql,array(trim($ind),trim($au['organisation']))); - if (!$row) - { - $sql="insert into responsible (individual,organisation,position,delivery,phone,email,city,country,administrative,postal) values(?,?,?,?,?,?,?,?,?,?)"; - $this->db->query($sql,array(trim($ind),trim($au['organisation']),trim($au['position']),trim($au['delivery']),trim($au['phone']),trim($au['email']),trim($au['city']),trim($au['country']),trim($au['administrative']),trim($au['postal']))); - } elseif (count($inds)==1) { - //deal email address - if (($au['email']) && empty($row->email)) - { - $sql="update responsible set email=? where id=?"; - $this->db->query($sql,array(trim($au['email']),$row->id)); - } - } - $sql="select id from responsible where individual=? and organisation=?"; - $row=$this->db->fetchRow($sql,array(trim($ind),trim($au['organisation']))); - if ($row->id>0) - { - $sql="insert into role (resid,uuid,role) values(?,?,?)"; - $this->db->query($sql,array($row->id,$iso->uuid,trim($au['role']))); - } - } - } - //处理数据限制信息 - foreach($iso->limits as $uselimit) - { - $sql="select id from uselimit where uselimit=?"; - $row=$this->db->fetchRow($sql,array($uselimit)); - if (!$row) - { - $sql="insert into uselimit (uselimit) values (?)"; - $this->db->query($sql,array($uselimit)); - } - $sql="select id from uselimit where uselimit=?"; - $row=$this->db->fetchRow($sql,array($uselimit)); - if ($row) - { - $sql="insert into mdlimit (uuid,lid) values(?,?)"; - $this->db->query($sql,array($iso->uuid,$row->id)); - } - } - $iso->save("../data/import/$iso->uuid.xml"); - } catch (Exception $e) { - //数据重复插入,此处忽略所有错误 - print $iso->uuid.' has error: '.$e->getMessage().'
'; - } + $iso->saveDB($this->db,$xml); } } diff --git a/application/admin/controllers/NewsController.php b/application/admin/controllers/NewsController.php index e98b3640..ab4ed7ba 100644 --- a/application/admin/controllers/NewsController.php +++ b/application/admin/controllers/NewsController.php @@ -7,7 +7,6 @@ class Admin_NewsController extends Zend_Controller_Action $this->view->config = Zend_Registry::get('config'); $this->messenger=$this->_helper->getHelper('FlashMessenger'); $this->view->messages = $this->messenger->getMessages(); - $this->_helper->layout->setLayout('administry');//新UI } function postDispatch() { @@ -15,13 +14,43 @@ class Admin_NewsController extends Zend_Controller_Action } function indexAction() { - + $sql = "select n.*,c.title as catlog,u.realname as author from news_archives n + left join news_category c on n.typeid=c.id + LEFT JOIN users u ON n.userid=u.id + order by n.ts_created desc limit 10"; + $rs = $this->db->query($sql); + $rows = $rs->fetchAll(); + $this->view->news = $rows; + + $sql = "SELECT count(id) as c FROM news_archives"; + $rs = $this->db->query($sql); + $row = $rs->fetch(); + $this->view->totle = $row; + + $sql = "SELECT count(id) as c FROM news_category"; + $rs = $this->db->query($sql); + $row = $rs->fetch(); + $this->view->typec = $row; }//indexAction 首页 function newslistAction(){ - $sql = "select n.*,c.title as catlog from news_archives n left join news_catlog c on n.typeid=c.id"; + $type = $this->_request->getParam('type'); + + if(!empty($type)) + { + $sql = "select n.*,c.title as catlog,c.url,u.realname as author from news_archives n + left join news_category c on n.typeid=c.id + LEFT JOIN users u ON n.userid=u.id + WHERE n.typeid='$type' order by n.ts_created desc"; + }else + { + $sql = "select n.*,c.title as catlog,c.url,u.realname as author from news_archives n + left join news_category c on n.typeid=c.id + LEFT JOIN users u ON n.userid=u.id + order by n.ts_created desc"; + } $rs = $this->db->query($sql); $rows = $rs->fetchAll(); @@ -32,6 +61,12 @@ class Admin_NewsController extends Zend_Controller_Action Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $this->view->paginator=$paginator; + $sql="select * from news_category order by displayorder desc"; + $re = $this->db->query($sql); + $types = $re->fetchAll(); + + $this->view->types=$types; + $this->view->type = $type; }//newslistAction 新闻列表 function catlogAction() @@ -46,13 +81,14 @@ class Admin_NewsController extends Zend_Controller_Action if($add) { if(empty($submit)) - $this->_helper->viewRenderer('catlogadd'); + $this->_helper->viewRenderer('category-add'); else{ $title = $this->_request->getParam('ctitle'); + $url = $this->_request->getParam('url'); $keyword = $this->_request->getParam('keyword'); $description = $this->_request->getParam('description'); - $sql="insert into news_catlog (title,keyword,description) values ('$title','$keyword','$description')"; + $sql="insert into news_category (title,keywords,description,url) values ('$title','$keyword','$description','$url')"; if($this->db->exec($sql) > 0) { $this->messenger->addMessage('提示信息:栏目添加成功!'); @@ -64,7 +100,7 @@ class Admin_NewsController extends Zend_Controller_Action }//栏目添加 if($delete>0) { - $sql = "delete from news_catlog where id='$delete'"; + $sql = "delete from news_category where id='$delete'"; if($this->db->exec($sql)>0) { $this->messenger->addMessage('提示信息:栏目删除成功!'); @@ -75,11 +111,12 @@ class Admin_NewsController extends Zend_Controller_Action if($edit>0) { $title = $this->_request->getParam('ctitle'); + $url = $this->_request->getParam('url'); $keyword = $this->_request->getParam('keyword'); $description = $this->_request->getParam('description'); $displayorder = $this->_request->getParam('displayorder'); - $sql="update news_catlog set title='$title',keyword='$keyword',description='$description',displayorder='$displayorder' where id='$edit'"; + $sql="update news_category set title='$title',keywords='$keyword',description='$description',displayorder='$displayorder',url='$url' where id='$edit'"; if($this->db->exec($sql)>0) { $this->messenger->addMessage('提示信息:栏目编辑成功!'); @@ -89,7 +126,7 @@ class Admin_NewsController extends Zend_Controller_Action else { - $sql="select * from news_catlog order by displayorder desc"; + $sql="select * from news_category order by displayorder asc"; $re=$this->db->query($sql); $catlogs=$re->fetchAll(); @@ -106,13 +143,15 @@ class Admin_NewsController extends Zend_Controller_Action $id = $this->_request->getParam('id'); if($id>0) { - $sql = "select id,title,pubtime,typeid from news_archives where id=$id"; + $sql = "SELECT arc.id,arc.title,arc.ts_published,arc.typeid,cat.url,cat.id as typeid from news_archives arc + LEFT JOIN news_category cat ON arc.typeid=cat.id + WHERE arc.id=$id"; $rs = $this->db->query($sql); $rows = $rs->fetch(); - if($rows['pubtime']>time()) + if($rows['ts_published']>time()) { - $title = "《{$rows['title']}》将在".date('Y-m-d H:i',$rows['pubtime'])."发布"; + $title = "《{$rows['title']}》将在".date('Y-m-d H:i',$rows['ts_published'])."发布"; } else { @@ -124,7 +163,7 @@ class Admin_NewsController extends Zend_Controller_Action $this->_helper->viewRenderer('newsaddok'); } - $sql="select * from news_catlog order by displayorder desc"; + $sql="select * from news_category order by displayorder desc"; $re = $this->db->query($sql); $types = $re->fetchAll(); @@ -132,13 +171,26 @@ class Admin_NewsController extends Zend_Controller_Action }//newsadd 新闻添加 + function replacehtml($html) + { + $newString = htmlentities($html, ENT_QUOTES, "UTF-8"); + return $newString; + } + function archivesaddAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $uid = $user->id; + } + $datavar = array( - 'title','writer','source','image','body','typeid','pub','pubtimer','pubtime','description','keyword' + 'title','source','image','body','typeid','pub','pubtimer','pubtime','description','keyword' ); foreach($_POST as $k=>$v) { @@ -150,10 +202,9 @@ class Admin_NewsController extends Zend_Controller_Action $msg=array(); if(empty($title)) $msg[]="标题不能为空"; - if(strlen($title)>40) $msg[]="标题长度不能超过40个字符"; - if(strlen($writer)>50) $msg[]="作者长度不能超过50个字符"; + if(strlen($title)>200) $msg[]="标题长度不能超过200个字符"; if(strlen($keyword)>200) $msg[] = "关键词长度不能超过200个字符,现在输入了".strlen($keyword)."个字符"; - if(strlen($description)>200) $msg[] = "内容描述不能超过200个字符,现在输入了".strlen($description)."个字符"; + if(strlen($description)>500) $msg[] = "内容描述不能超过200个字符,现在输入了".strlen($description)."个字符"; if(empty($body)) $msg[]="请填写内容"; if($typeid==0) $msg[]="请选择栏目"; @@ -174,40 +225,41 @@ class Admin_NewsController extends Zend_Controller_Action { if(!empty($pubtimer)) { - $pubtime = strtotime($pubtime); + $pubtime = date("Y-m-d H:i:s",strtotime($pubtime)); } else { - $pubtime = time(); + $pubtime = date("Y-m-d H:i:s",time()); } $date=array( - 'title' => $title, - 'writer' => $writer, - 'keyword' => $keyword, - 'description'=> $description, - 'image' => $image, - 'writetime' => time(), + 'title' => $this->db->quote($this->replacehtml($title)), + 'writer' => $uid, + 'keyword' => $this->db->quote($this->replacehtml($keyword)), + 'description'=> $this->db->quote($this->replacehtml($description)), + 'image' => $image, 'pubtime' => $pubtime, 'source' => $source, 'typeid' => $typeid, 'pub' => $pub, - 'body' => $body + 'body' => $this->db->quote($body) ); - $sql = "INSERT INTO news_archives (title,writer,keyword,description,image,writetime,pubtime,source,typeid,pub) - VALUES ('{$date['title']}', - '{$date['writer']}', - '{$date['keyword']}', - '{$date['description']}', + $sql = "INSERT INTO news_archives (title,userid,keywords,description,image,ts_published,source,typeid,is_pub,body) + VALUES ( + ".$date['title'].", + ".$date['writer'].", + ".$date['keyword'].", + ".$date['description'].", '{$date['image']}', - '{$date['writetime']}', '{$date['pubtime']}', '{$date['source']}', '{$date['typeid']}', - '{$date['pub']}') + '{$date['pub']}', + ".$date['body']." + ) RETURNING id "; @@ -216,19 +268,11 @@ class Admin_NewsController extends Zend_Controller_Action if($sth->execute()) { $temp = $sth->fetch(PDO::FETCH_ASSOC); - $sql = "INSERT INTO news_archivesaddon (id,body) values ('{$temp['id']}','{$date['body']}')"; - if($this->db->exec($sql)>0) - { - echo '
发布成功!
'; - } - else - { - $sql = "delete from news_archives where id={$temp['id']}"; - $this->db->exec($sql); - echo '
发布失败!写入附加表出错,请联系管理员
'; - } + echo '
发布成功!
'; + }else{ + echo '
发布失败!请重试
'; } }catch(Exception $e){ @@ -238,31 +282,155 @@ class Admin_NewsController extends Zend_Controller_Action
  • '.$e->getMessage().'
  • '; - } - - - - - - - + } } - /* + }// 文章发布 + + function newseditAction() + { -
    Info box sample
    -
    Warning box sample
    -
    Error box sample
    + $id = $this->_request->getParam('id'); + + $sql = "select * from news_archives arc where arc.id=$id + "; + $rs = $this->db->query($sql); + $row = $rs->fetch(); + + $this->view->ev = $row; + + $sql="select * from news_category order by displayorder desc"; + $re = $this->db->query($sql); + $types = $re->fetchAll(); + + $this->view->types=$types; + } + + function archiveseditAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + + $id = $this->_request->getParam('id'); + + if(empty($id)) + { + echo '
    发布失败:
    +
    +
      '; + echo '
    1. 参数错误
    2. '. + '
    +
    + '; + } + + $auth = Zend_Auth::getInstance(); + if($auth->hasIdentity()) + { + $user = $auth->getIdentity(); + $uid = $user->id; + } + + $datavar = array( + 'title','source','image','body','typeid','pub','pubtimer','pubtime','description','keyword' + ); + + + foreach($_POST as $k=>$v) + { + if(in_array($k,$datavar)) + { + $$k=$v; + } + } + + $msg=array(); + if(empty($title)) $msg[]="标题不能为空"; + if(strlen($title)>200) $msg[]="标题长度不能超过200个字符"; + if(strlen($keyword)>200) $msg[] = "关键词长度不能超过200个字符,现在输入了".strlen($keyword)."个字符"; + if(strlen($description)>500) $msg[] = "内容描述不能超过500个字符,现在输入了".strlen($description)."个字符"; + if(empty($body)) $msg[]="请填写内容"; + if($typeid==0) $msg[]="请选择栏目"; + + if(count($msg)>0) + { + echo '
    发布失败:
    +
    +
      '; + foreach ($msg as $v) + { + echo '
    1. '.$v.'
    2. '; + } + echo'
    +
    + '; + } + else + { + $pubtime = date("Y-m-d H:i:s",strtotime($pubtime)); + $date=array( + 'title' => $this->replacehtml($title), + 'writer' => $uid, + 'keyword' => $this->replacehtml($keyword), + 'description'=> $this->replacehtml($description), + 'image' => $image, + 'pubtime' => $pubtime, + 'source' => $this->replacehtml($source), + 'typeid' => $typeid, + 'pub' => $pub, + 'body' => $this->db->quote($body) + ); + + + + $sql = "UPDATE news_archives SET + title='{$date['title']}', + userid='{$date['writer']}', + keywords='{$date['keyword']}', + description='{$date['description']}', + image='{$date['image']}', + ts_published='{$date['pubtime']}', + source='{$date['source']}', + typeid='{$date['typeid']}', + is_pub='{$date['pub']}', + body=".$date['body']." + WHERE id='$id' + "; + + try{ + $sth = $this->db->prepare($sql); + if($sth->execute()) + { + echo '
    发布成功!
    '; + + }else{ + echo '
    发布失败!写入附加表出错,请联系管理员
    '; + } + + }catch(Exception $e){ + echo '
    文章发布失败:
      -
    1. Credit card number entered is invalid
    2. -
    3. Credit card verification number must be a valid number
    4. +
    5. '.$e->getMessage().'
    -
    -
    Success box sample
    - - */ + '; + } + } + }// 文章编辑 + + function deleteAction(){ - } + $id = $this->_request->getParam('id'); + + $sql = "DELETE FROM news_archives WHERE id='$id'"; + + $this->db->exec($sql); + + $this->messenger->addMessage('提示信息:文章删除成功!'); + $this->_redirect('/admin/news/newslist'); + + }//文章删除 } diff --git a/application/admin/controllers/WatermdController.php b/application/admin/controllers/WatermdController.php index fcf44d13..126d8bdd 100644 --- a/application/admin/controllers/WatermdController.php +++ b/application/admin/controllers/WatermdController.php @@ -7,7 +7,7 @@ class Admin_WatermdController extends Zend_Controller_Action $this->view->config = Zend_Registry::get('config'); $this->messenger=$this->_helper->getHelper('FlashMessenger'); $this->view->messages = $this->messenger->getMessages(); - $this->wdb=Zend_Db::factory($this->view->config->waterdb); + $this->wdb=Zend_Db::factory($this->view->config->geonetwork); set_time_limit(0); } function postDispatch() diff --git a/application/admin/views/scripts/news/category-add.phtml b/application/admin/views/scripts/news/category-add.phtml new file mode 100644 index 00000000..2dd3f4a7 --- /dev/null +++ b/application/admin/views/scripts/news/category-add.phtml @@ -0,0 +1,60 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('栏目添加'); +?> +
    +partial('news/left.phtml'); ?> +
    +
    +msg or $this->messages) :?> +
    +msg) : ?> +

    msg; ?>

    +messages): foreach($this->messages as $msg): ?> +

    + +
    + +
    + +
    + 栏目添加 + +

    +
    + +

    + +

    +
    + (仅小写英文字母与数字) + 如填写: technology 则前台访问地址为: http://westdc.westgis.ac.cn/news/technology +

    + +

    +
    + + e.g. 高程,气象,地理 +

    + +

    +
    + + 80个汉字以内,不能使用折行 +

    + + + +

    or

    + +
    + +
    +
    \ No newline at end of file diff --git a/application/admin/views/scripts/news/catlog.phtml b/application/admin/views/scripts/news/catlog.phtml index 993f88d0..15ea8c9f 100644 --- a/application/admin/views/scripts/news/catlog.phtml +++ b/application/admin/views/scripts/news/catlog.phtml @@ -2,83 +2,77 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headScript()->appendFile('/static/js/jquery.dataTables.min.js'); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); + $this->headLink()->appendStylesheet('/css/author.css'); + $this->headLink()->appendStylesheet('/css/colorbox.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('栏目管理'); ?> - - -
    -
    -

    新闻中心

    - -
    -
    -
    - - - -
    - -
    - - - - - - -
    - -

    栏目管理

    -
    - - msg or $this->messages) :?> -
    - msg) : ?> - msg; ?> - messages): foreach($this->messages as $msg): ?> - - - -
    - - - - - - - - - - - catlogs)) - { - foreach($this->catlogs as $k=>$v) - { - echo ' - - +
    栏目名称栏目管理
    -
    - '.$v['title'].' -
    -
    - 编辑栏目 -
    - -
    + +
    +partial('news/left.phtml'); ?> +
    +
    +msg or $this->messages) :?> +
    +msg) : ?> +

    msg; ?>

    +messages): foreach($this->messages as $msg): ?> +

    + +
    + + + + + + + + + + + catlogs)) + { + foreach($this->catlogs as $k=>$v) + { + echo ' + + @@ -119,29 +115,15 @@ } ?> - -
    栏目名称栏目管理
    +
    + '.$v['title'].' +
    +
    + 编辑栏目 关闭 + +
    栏目信息


    + +

    +
    + (仅小写英文字母与数字) + 如填写: technology 则前台访问地址为: http://westdc.westgis.ac.cn/news/technology +


    - + e.g. 高程,气象,地理

    @@ -105,6 +99,8 @@
    + 浏览 + 文档 编辑 删除
    - -
    -  添加新栏目 - - - - - - - -
    - -
    - +
    + +
    \ No newline at end of file diff --git a/application/admin/views/scripts/news/index.phtml b/application/admin/views/scripts/news/index.phtml index 0a51f11a..59d0fd34 100644 --- a/application/admin/views/scripts/news/index.phtml +++ b/application/admin/views/scripts/news/index.phtml @@ -2,82 +2,101 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); ?> - -
    -
    -

    新闻中心

    - - -
    -
    - - - -
    - -
    - - - - - - -
    + +
    +partial('news/left.phtml'); ?> +
    +
    +msg or $this->messages) :?> +
    +msg) : ?> +

    msg; ?>

    +messages): foreach($this->messages as $msg): ?> +

    + +
    + -

    最新发布的新闻

    -
    - - - - -
     
    - -
    - - - - -
    - -
    - - - +

    最新发布的新闻

    +
    + + + + + + + + + + news)) + { + foreach ($this->news as $v) + { + echo ' + + + + + + '; + } + } + else + { + echo ' + + '; + } + ?> + + +
    新闻标题所属栏目新闻管理
    +
    + '.$v['title'].' +
    +
    + 详细信息 关闭 +

    作者:'.$v['author'].'

    +

    关键词:'.$v['keywords'].'

    +

    描述:'.$v['description'].'

    +

    添加时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'

    +

    发布时间:'.date("Y-m-d H:i",strtotime($v['ts_published'])).'

    +

    来源:'.$v['source'].'

    +

    点击:'.$v['click'].'

    +
    +
    +
    '.$v['catlog'].' + 编辑 + 删除
    暂无数据
    - \ No newline at end of file diff --git a/application/admin/views/scripts/news/left.phtml b/application/admin/views/scripts/news/left.phtml index b69b0dc7..ff15a664 100644 --- a/application/admin/views/scripts/news/left.phtml +++ b/application/admin/views/scripts/news/left.phtml @@ -1,32 +1,8 @@ -
    -
    -

    新闻中心管理

    -
    -
    - -
    -
    栏目管理
    -
    创建、编辑、删除栏目
    - -
    -
    新闻管理
    -
    查看、编辑、搜索、删除新闻
    - -
    -
    发布新闻
    -
    为网站发布一篇新闻
    -
    -
    -
    -
    -

    Tips

    -
    -
    -
    -
    在栏目编辑中,再次点击“编辑”按钮可以关闭栏目编辑窗口
    -
    去试试
    -
    新闻添加中可以直接上传图片
    -
    去试试
    -
    -
    -
    \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/news/newsadd.phtml b/application/admin/views/scripts/news/newsadd.phtml index 2773905e..e76c46b5 100644 --- a/application/admin/views/scripts/news/newsadd.phtml +++ b/application/admin/views/scripts/news/newsadd.phtml @@ -2,10 +2,16 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); $this->headScript()->appendFile('/static/js/jquery.tagInput.min.js'); $this->headScript()->appendFile('/static/js/kindeditor-min.js'); $this->headScript()->appendFile('/static/js/kindlang/zh_CN.js'); - $this->headLink()->appendStylesheet('/static/css/kindskin/default/default.css'); + $this->headLink()->appendStylesheet('/static/css/kindskin/default/default.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('新闻添加'); ?> realname; } ?> + - -
    -
    -

    新闻中心

    - -
    -
    -
    - - - -
    - -
    - - - - - - +
    +partial('news/left.phtml'); ?> +
    +
    - -

    发布新闻

    @@ -96,11 +83,6 @@ $(document).ready(function(){

    -

    -
    - -

    -


    @@ -109,6 +91,7 @@ $(document).ready(function(){


    +

    @@ -161,15 +144,18 @@ $(document).ready(function(){

    +
    +
    +

    新闻标签

    +
    +
    + 输入Tag标签,多个用半角逗号 " , "隔开,每个Tag标签长度小于6个汉字 +

    +
    +
    - - - -
    - -
    - +
    \ No newline at end of file diff --git a/application/admin/views/scripts/news/newsaddok.phtml b/application/admin/views/scripts/news/newsaddok.phtml index 9952c3ab..d54d6468 100644 --- a/application/admin/views/scripts/news/newsaddok.phtml +++ b/application/admin/views/scripts/news/newsaddok.phtml @@ -1,102 +1,27 @@ headTitle($this->config->title->site); $this->headTitle('后台管理'); - $this->headTitle()->setSeparator(' - '); - $this->headScript()->appendFile('/static/js/jquery.tagInput.min.js'); - $this->headScript()->appendFile('/static/js/kindeditor-min.js'); - $this->headScript()->appendFile('/static/js/kindlang/zh_CN.js'); - $this->headLink()->appendStylesheet('/static/css/kindskin/default/default.css'); -?> -hasIdentity()) - { - $user = $auth->getIdentity(); - $uname=$user->username; - $realname = $user->realname; - } + $this->headTitle()->setSeparator(' - '); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('新闻发布'); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); ?> +
    +partial('news/left.phtml'); ?> +
    +
    +

    title;?>

    + - -
    -
    -

    新闻中心

    - -
    -
    -
    - - - -
    - -
    - - - - - - -
    - -

    title;?>

    - - - -
    - - - - -
    - -
    - - \ No newline at end of file + \ No newline at end of file diff --git a/application/admin/views/scripts/news/newsedit.phtml b/application/admin/views/scripts/news/newsedit.phtml new file mode 100644 index 00000000..8657ba27 --- /dev/null +++ b/application/admin/views/scripts/news/newsedit.phtml @@ -0,0 +1,224 @@ +headTitle($this->config->title->site); + $this->headTitle('后台管理'); + $this->headTitle()->setSeparator(' - '); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headScript()->appendFile('/static/js/jquery.tagInput.min.js'); + $this->headScript()->appendFile('/static/js/kindeditor-min.js'); + $this->headScript()->appendFile('/static/js/kindlang/zh_CN.js'); + $this->headLink()->appendStylesheet('/static/css/kindskin/default/default.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('新闻编辑'); +?> +hasIdentity()) + { + $user = $auth->getIdentity(); + $uname=$user->username; + $realname = $user->realname; + } +?> + + +
    +partial('news/left.phtml'); ?> +
    +
    +
    + +

    发布新闻

    + +
    + +
    + 新闻信息 + +

    +
    + +

    + +

    +
    + +

    + +

    +
    + + +

    + +

    +
    + +

    + + + +
    +
    +

    +
    + + e.g. 研究成果 +

    +

    + 添加新栏目

    + +

    + +

    +
    + +
    +

    +
    + ev['ts_published']));?>" readonly="readonly" /> + e.g. 2011-10-28 9:35 or 2011-10-28 21:35 +

    +
    +
    +
    +
    +

    新闻标签

    +
    +
    + 输入Tag标签,多个用半角逗号 " , "隔开,每个Tag标签长度小于6个汉字 +

    +
    +
    +
    + +

    or

    + +
    + +
    +
    +
    + \ No newline at end of file diff --git a/application/admin/views/scripts/news/newslist.phtml b/application/admin/views/scripts/news/newslist.phtml index 448c8eea..a1dd1840 100644 --- a/application/admin/views/scripts/news/newslist.phtml +++ b/application/admin/views/scripts/news/newslist.phtml @@ -2,124 +2,134 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headScript()->appendFile('/static/js/jquery.dataTables.min.js'); + $this->headScript()->appendFile('/js/jquery-1.7.min.js'); + $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headScript()->appendFile('/js/jquery.colorbox-min.js'); + $this->headLink()->appendStylesheet('/css/author.css'); + $this->headLink()->appendStylesheet('/css/colorbox.css'); + $this->breadcrumb('首页'); + $this->breadcrumb('后台首页'); + $this->breadcrumb('新闻中心'); + $this->breadcrumb('新闻列表'); ?> - - -
    -
    -

    新闻中心

    - -
    -
    -
    - - - -
    - -
    - - - - + + +
    +partial('news/left.phtml'); ?> +
    +
    +msg or $this->messages) :?> +
    +msg) : ?> +

    msg; ?>

    +messages): foreach($this->messages as $msg): ?> +

    + +
    + +
    + +  +所有新闻列表 +
    + + + + + + + + + + + paginator)) + { + $list = ""; + foreach ($this->paginator as $v) + { + $list .= ' + + + + + + + '; + } + echo $list; + } + else + { + echo ' + + '; + } + ?> - -
    - -

    新闻列表

    -
    - - - - msg or $this->messages) :?> -
    - msg) : ?> - msg; ?> - messages): foreach($this->messages as $msg): ?> - - - -
    - - -
    新闻标题所属栏目状态新闻管理
    +
    + '.$v['title'].' +
    +
    + 详细信息 +

    作者:'.$v['author'].'

    +

    关键词:'.$v['keywords'].'

    +

    描述:'.$v['description'].'

    +

    添加时间:'.date("Y-m-d H:i",strtotime($v['ts_created'])).'

    +

    发布时间:'.date("Y-m-d H:i",strtotime($v['ts_published'])).'

    +

    来源:'.$v['source'].'

    +

    点击:'.$v['click'].'

    +
    +
    +
    '.$v['catlog'].''; + if($v['ts_published']0) + { + $list.="已发布"; + } + if($v['ts_published']>time() and $v['is_pub']>0) + { + $list.= date('Y-m-d H:i',$v['ts_published']) . '发布'; + } + if($v['is_pub']==0) + { + $list.="草稿"; + } + if($v['is_pub']<0) + { + $list.="未发布"; + } + $list .= ' + 预览 + 编辑 + 删除
    暂无数据
    - - - - - - - - - paginator)) - { - foreach ($this->paginator as $v) - { - echo ' - - - - - - '; - } - } - else - { - echo ' - - '; - } - ?> - - -
    新闻标题所属栏目新闻管理
    -
    - '.$v['title'].' -
    -
    - 详细信息 -

    作者:'.$v['writer'].'

    -

    关键词:'.$v['keyword'].'

    -

    描述:'.$v['description'].'

    -

    添加时间:'.date("Y-m-d H:i",$v['writetime']).'

    -

    发布时间:'.date("Y-m-d H:i",$v['pubtime']).'

    -

    来源:'.$v['source'].'

    -

    点击:'.$v['click'].'

    -
    -
    -
    '.$v['catlog'].' - 编辑 - 删除
    暂无数据
    - -
    - - - - - - - - -
    - -
    - + + + +
    '; + $this->getResponse()->setHeader('Content-Type', 'text/html') + ->setBody($content); + } + + //footer output + function footerAction() + { + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $footer=file_get_contents('../application/default/views/scripts/footer.phtml'); + $this->getResponse()->setHeader('Content-Type', 'text/html') + ->setBody($footer); + } + +} diff --git a/application/default/views/scripts/about/background.phtml b/application/default/views/scripts/about/background.phtml index b46af9d6..77a3fd2b 100644 --- a/application/default/views/scripts/about/background.phtml +++ b/application/default/views/scripts/about/background.phtml @@ -1,14 +1,20 @@ headTitle($this->config->title->site); - $this->headTitle('项目背景'); +$this->headTitle($this->config->title->site); +$this->headTitle('发展历史'); $this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/terms.css'); +$this->headLink()->appendStylesheet('/css/about.css'); $this->breadcrumb('首页'); $this->breadcrumb('关于本站'); -$this->breadcrumb('项目背景'); +$this->breadcrumb('发展历史'); $this->breadcrumb()->setSeparator(' > '); ?> -
    + +
    +

    发展历史

    2007年12月29日,国家发改委正式批复《青海湖流域生态环境保护与综合治理规划》(以下简称《规划》),《规划》范围为刚察、海晏、天峻、共和4县的青海湖流域,面积29661平方公里。《规划》实施期为10年,建设内容分为湿地保护与环境治理工程、退化土地保护与治理工程、生物多样性保护工程、农牧民生产生活条件改善工程和技术支撑与管理工程等五个工程类别。生态监测体系建设项目列在技术支撑与管理工程中,由青海省环境保护厅负责生态监测体系建设项目的实施。

    根据《青海湖流域生态环境保护与综合治理工程规划》的要求,青海湖流域生态环境监测体系建设的总体目标是:整合现有监测资源,合理布局新的监测站点,在青海湖流域建设一个时空分布合理,点面结合,可操作性强的生态环境监测体系;及时掌握各流域生态因子的动态变化,准确反映生态环境质量现状、演化规律和工程实施效果;建成生态环境监测、科研、教学和公众参与的信息平台、技术保障平台,实现基础数据和资料的系统观测、连续积累、科学存储、有效利用;对全流域生态系统和生态治理成效评估,为流域资源、环境、人口的管理和经济发展提供决策依据。

    本项目是青海湖流域生态环境监测体系建设项目的主要建设内容之一,依托数据库、互联网和地理信息系统技术,组建基于互联网的生态环境数据共享平台,发掘生态监测数据的科学价值,辅助生态环境变化过程中的科学问题研究,充分发挥青海湖流域生态环境监测体系建设项目的投资效益。

    diff --git a/application/default/views/scripts/about/contact.phtml b/application/default/views/scripts/about/contact.phtml index a17bade9..947c7036 100755 --- a/application/default/views/scripts/about/contact.phtml +++ b/application/default/views/scripts/about/contact.phtml @@ -1,13 +1,18 @@ headTitle($this->config->title->site); - $this->headTitle('联系我们'); +$this->headTitle($this->config->title->site); +$this->headTitle('联系我们'); $this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/contact.css'); +$this->headLink()->appendStylesheet('/css/about.css'); $this->breadcrumb('首页'); $this->breadcrumb('关于本站'); $this->breadcrumb('联系我们'); $this->breadcrumb()->setSeparator(' > '); ?> +
    联系我们

    离线方式

    diff --git a/application/default/views/scripts/about/copyright.phtml b/application/default/views/scripts/about/copyright.phtml new file mode 100644 index 00000000..5a723fda --- /dev/null +++ b/application/default/views/scripts/about/copyright.phtml @@ -0,0 +1,21 @@ +headTitle($this->config->title->site); +$this->headTitle('联系我们'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('联系我们'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    数据与版权

    +整体说明 +我们的理解 + 数据中各个角色的不同,如何定义,各自拥有什么权限 +
    \ No newline at end of file diff --git a/application/default/views/scripts/about/honor.phtml b/application/default/views/scripts/about/honor.phtml new file mode 100644 index 00000000..8f932876 --- /dev/null +++ b/application/default/views/scripts/about/honor.phtml @@ -0,0 +1,22 @@ +headTitle($this->config->title->site); +$this->headTitle('服务成效'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('服务成效'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    服务成效

    +

    标注数据论文

    +

    数据中心发表论文

    +

    专利与著作权

    +

    奖励

    +

    \ No newline at end of file diff --git a/application/default/views/scripts/about/index.phtml b/application/default/views/scripts/about/index.phtml index 59f2280d..9f358b21 100755 --- a/application/default/views/scripts/about/index.phtml +++ b/application/default/views/scripts/about/index.phtml @@ -1,10 +1,10 @@ headTitle($this->config->title->site); - $this->headTitle('关于本站'); +$this->headTitle($this->config->title->site); +$this->headTitle('关于我们'); $this->headTitle()->setSeparator(' - '); $this->headLink()->appendStylesheet('/css/about.css'); $this->breadcrumb('首页'); -$this->breadcrumb('关于本站'); +$this->breadcrumb('关于我们'); $this->breadcrumb()->setSeparator(' > '); ?>
    diff --git a/application/default/views/scripts/about/legal.phtml b/application/default/views/scripts/about/legal.phtml new file mode 100644 index 00000000..3d15aeb7 --- /dev/null +++ b/application/default/views/scripts/about/legal.phtml @@ -0,0 +1,58 @@ +headTitle($this->config->title->site); +$this->headTitle('隐私政策'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('隐私政策'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    隐私政策

    +

    + 中国西部环境与生态科学数据中心感谢您关注其科学数据品和访问本网站。您可以通过多种不同的方式使用我们的服务,例如查看数据、下载数据、搜索和分享数据或者分享科学数据等。 + 我们很注重您的个人隐私权。保护您的个人隐私是我们特别关注的一项重要工作。 + 我们希望让您清楚地了解我们对信息的使用方式,以及您可采用什么方式来保护自己的隐私权。

    +

    同时,本网站包含到其它网站的链接,而那些网站并非属于本隐私声明的覆盖范围。

    +

    我们的隐私权政策解释了以下几个方面的问题:

    +
    • 我们收集哪些信息,以及收集这些信息的原因。
    • +
    • 我们对这些信息的使用方式。
    • +
    + +

    我们收集的信息

    +

    我们有两种信息收集方式:

    +

    1.您向我们提供信息。我们的很多服务都要求您注册成为数据中心的用户。而在您注册数据中心用户时, + 我们会要求您提供个人信息,例如您的姓名、电子邮件地址、电话号码等。 +

    +

    2.我们在您使用服务的过程中获取信息。我们会收集关于您使用的服务以及使用方式的信息, + 例如您在何时下载了某条数据。此类信息包括设备信息、日志信息等。 +

    +

    我们如何使用收集到的信息

    +

    我们利用从所有服务中收集的信息来提供、维护、保护和改进这些服务。 +

    +

    当我们要将信息用于本隐私权政策未载明的其它用途时,则会事先征求您的同意。

    +

    访问和更新个人信息

    +

    无论您在何时使用我们的服务,我们都力求让您能够访问自己的个人信息。 + 如果这些信息有误,我们会努力通过各种方式让您快速更新信息或删除信息(除非我们出于合法业务或法律方面的原因而必须保留这些信息)。 + 在更新您的个人信息时,我们可能会要求您先验证自己的身份,然后再处理您的请求。

    +

    + 对于那些无端重复、需要过多技术投入(例如开发一个新系统或从根本上改变现行惯例)、 + 对他人隐私权造成风险或者非常不切实际(例如关于在备份磁带上存放信息的请求)的请求,我们可能予以拒绝。 +

    +

    我们分享的信息

    +

    1. 您在申请数据后,数据所有者能看到您的申请信息,包括您数据的用途、姓名、单位、电话等信息。

    +

    2. 您在成功申请数据后,该数据页面可能会显示您曾经使用过该数据,页面公开的信息包括您的姓名、单位、申请用途以及申请的时间信息。

    +

    信息安全

    +

    1. 用户的密码在我们的服务器上采用不可逆算法进行了加密。

    +

    2. 用于FTP下载登录的密码和您在网站上登录的密码没有相关性,而且也采用了不可逆算法进行了加密。

    +

    3. 我们会审查数据存储、处理和备份方面的各种措施(包括物理性安全措施),以避免各系统遭到未经授权的访问。

    +

    适用范围

    +

    我们的隐私权政策适用于由中国西部环境与生态科学数据中心及其关联机构提供的所有服务,但不适用于由其他公司或个人提供的服务。

    +

    我们会定期检查隐私权政策的遵守情况。我们收到正式的书面投诉后,会与投诉人联系,以便采取进一步行动。

    +
    \ No newline at end of file diff --git a/application/default/views/scripts/about/link.phtml b/application/default/views/scripts/about/link.phtml new file mode 100644 index 00000000..a54434a8 --- /dev/null +++ b/application/default/views/scripts/about/link.phtml @@ -0,0 +1,20 @@ +headTitle($this->config->title->site); +$this->headTitle('友情链接'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('友情链接'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    友情链接

    +合作站点: +科学数据相关站点: +
    \ No newline at end of file diff --git a/application/default/views/scripts/about/navi.phtml b/application/default/views/scripts/about/navi.phtml new file mode 100644 index 00000000..293962b8 --- /dev/null +++ b/application/default/views/scripts/about/navi.phtml @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/application/default/views/scripts/about/sponsors.phtml b/application/default/views/scripts/about/sponsors.phtml new file mode 100644 index 00000000..29995200 --- /dev/null +++ b/application/default/views/scripts/about/sponsors.phtml @@ -0,0 +1,22 @@ +headTitle($this->config->title->site); +$this->headTitle('支持项目'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('支持项目'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    支持项目

    +

    标注数据论文

    +

    数据中心发表论文

    +

    专利与著作权

    +

    奖励

    +

    \ No newline at end of file diff --git a/application/default/views/scripts/about/supportus.phtml b/application/default/views/scripts/about/supportus.phtml new file mode 100644 index 00000000..e6443861 --- /dev/null +++ b/application/default/views/scripts/about/supportus.phtml @@ -0,0 +1,22 @@ +headTitle($this->config->title->site); +$this->headTitle('支持我们'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/about.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('关于本站'); +$this->breadcrumb('支持我们'); +$this->breadcrumb()->setSeparator(' > '); +?> + +
    +

    支持我们

    +支持的方式: + 大力参与! + 共享您产生的科学数据! +我们在数据整理/共享方面有自己独到的简介,如大项目,也可合作! +
    \ No newline at end of file diff --git a/application/default/views/scripts/author/accept-active.phtml b/application/default/views/scripts/author/accept-active.phtml new file mode 100644 index 00000000..41030b6f --- /dev/null +++ b/application/default/views/scripts/author/accept-active.phtml @@ -0,0 +1,27 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('我的数据'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + info; ?> +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/accept.phtml b/application/default/views/scripts/author/accept.phtml new file mode 100644 index 00000000..23cff475 --- /dev/null +++ b/application/default/views/scripts/author/accept.phtml @@ -0,0 +1,86 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('我的数据'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    +

    请输入元数据标题关键字进行搜索

    +
    + + +
    +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • + +

      +

      + 您已经申请该数据,请到邮箱查看激活邮件(如果没有收到请 点击这里)'; + } + ?> + +

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/apply.phtml b/application/default/views/scripts/author/apply.phtml new file mode 100644 index 00000000..469fe95a --- /dev/null +++ b/application/default/views/scripts/author/apply.phtml @@ -0,0 +1,99 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('申请成为元数据作者'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    +

    请输入元数据标题关键字进行搜索

    +
    + + +
    +
    + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/authored-list.phtml b/application/default/views/scripts/author/authored-list.phtml new file mode 100644 index 00000000..6adf12a5 --- /dev/null +++ b/application/default/views/scripts/author/authored-list.phtml @@ -0,0 +1,48 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('数据反馈管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • +

      评论者:) 评论时间:

      +

        

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/authored-listall.phtml b/application/default/views/scripts/author/authored-listall.phtml new file mode 100644 index 00000000..f5d7f3db --- /dev/null +++ b/application/default/views/scripts/author/authored-listall.phtml @@ -0,0 +1,49 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('数据反馈管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • +

      +

      评论者:) 评论时间:

      +

        

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/authored.phtml b/application/default/views/scripts/author/authored.phtml new file mode 100644 index 00000000..f6d2583e --- /dev/null +++ b/application/default/views/scripts/author/authored.phtml @@ -0,0 +1,48 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('数据反馈管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • +

      +

      反馈数: 查看详细

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/help.phtml b/application/default/views/scripts/author/help.phtml new file mode 100644 index 00000000..20a7ee57 --- /dev/null +++ b/application/default/views/scripts/author/help.phtml @@ -0,0 +1,27 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('申请成为元数据作者'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/inauthor-offline.phtml b/application/default/views/scripts/author/inauthor-offline.phtml new file mode 100644 index 00000000..3330c3d7 --- /dev/null +++ b/application/default/views/scripts/author/inauthor-offline.phtml @@ -0,0 +1,83 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('数据申请管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    离线数据申请默认为同意下载
    +

    请输入元数据标题关键字进行搜索

    +
    + + +
    +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • +

      +

      用户:  + 单位:  + 申请时间:

      +

      项目:

      +

      +

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/inauthor.phtml b/application/default/views/scripts/author/inauthor.phtml new file mode 100644 index 00000000..16c3a9e0 --- /dev/null +++ b/application/default/views/scripts/author/inauthor.phtml @@ -0,0 +1,59 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); + +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb('数据作者'); +$this->breadcrumb('数据申请管理'); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    + +
    这里仅显示您的数据的离线及在线数据申请。
    +

    请输入元数据标题关键字进行搜索

    +
    + + +
    +
    + paginator)): + echo "
      "; + $autoindex=0; + foreach ($this->paginator as $item): + $autoindex++;?> +
    • +

      +

      用户:  + 单位:  + 申请时间:

      +

      项目:

      +

      +
    • + "; + endif; ?> + +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/index.phtml b/application/default/views/scripts/author/index.phtml new file mode 100755 index 00000000..d792273d --- /dev/null +++ b/application/default/views/scripts/author/index.phtml @@ -0,0 +1,53 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->author); +$this->headTitle()->setSeparator(' - '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headLink()->appendStylesheet('/css/author.css'); +$this->breadcrumb('首页'); +$this->breadcrumb($this->config->title->author); +$this->breadcrumb()->setSeparator(' > '); +?> + + + + + +
    +
    +
      +
    • +

      数据作者系统有什么功能?

      +
      +

      1、进行数据认证

      +

      您在数据中心发布了一条数据,若需对数据进行修改,则需要进行数据认证。

      +
      +
    • +
    • +

      如何成为已发布数据的作者

      +
      +

      登录后,进入网站的“数据作者”→“数据认证”页面,在搜索框内输入您的数据的关键字,然后点击搜索,带列表加载后,点击数据介绍下方的“申请成为此数据的作者”即可进入申请步骤。该功能需要登录后使用(点击这里可以进入数据认证)

      +
      +
    • +
    • +

      在线、离线数据查看与审批功能

      +
      +

      1.在线数据申请记录查看:

      +

      点击网站主导航"数据作者",进入数据作者页面后,点击左侧导航栏的"数据申请管理"。默认进入在线数据申请记录页面,在线数据申请不需要审批,用户可直接下载。该功能需要登录后使用(点击这里可以进入在线申请记录)

      +

      2.离线数据申请记录查看:

      +

      点击网站主导航"数据作者",进入数据作者页面后,点击左侧导航栏的"数据申请管理"。然后点击右侧页面顶部的"离线申请记录"(默认选中的是"在线下载记录")。该功能需要登录后使用(点击这里可以进入离线申请记录)

      +

      3.离线数据申请审批

      +

      进入"离线申请记录"页面后,在右侧页面可以看到离线申请列表,通过点击每条记录下面的"同意"按钮来确认同意用户的下载申请,点击"反对"来确认用户不能下载该数据。在数据送达前可以修改意见。当前数据如果已经有意见,则显示为淡蓝色背景(改类按钮表示被选中)

      +
      +
    • +
    +
    +
    + + \ No newline at end of file diff --git a/application/default/views/scripts/author/navi.phtml b/application/default/views/scripts/author/navi.phtml new file mode 100644 index 00000000..af14565f --- /dev/null +++ b/application/default/views/scripts/author/navi.phtml @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/application/default/views/scripts/data/thumb.phtml b/application/default/views/scripts/data/thumb.phtml new file mode 100644 index 00000000..9ba465ed --- /dev/null +++ b/application/default/views/scripts/data/thumb.phtml @@ -0,0 +1,36 @@ +headTitle($this->config->title->site); +$this->headTitle($this->config->title->data); +$this->headTitle('缩略图浏览'); +$this->headTitle()->setSeparator(' - '); +$this->headLink()->appendStylesheet('/css/water.css'); +$this->breadcrumb('首页'); +$this->breadcrumb(''.$this->config->title->data.''); +$this->breadcrumb('缩略图浏览'); +$this->breadcrumb()->setSeparator(' > '); +$this->headScript()->appendFile('/js/jquery-1.7.min.js'); +$this->headScript()->appendFile('/js/jquery.colorbox-min.js'); +$this->headLink()->appendStylesheet('/css/colorbox.css'); +?> + +page->getNavigation(); ?> +
    +
    +metadata as $md) : ?> + + +
    +
    +page->getNavigation(); ?> + + \ No newline at end of file diff --git a/application/default/views/scripts/news/archive.phtml b/application/default/views/scripts/news/archive.phtml new file mode 100644 index 00000000..e02ba3d4 --- /dev/null +++ b/application/default/views/scripts/news/archive.phtml @@ -0,0 +1,54 @@ +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 new file mode 100644 index 00000000..f6ebe2e1 --- /dev/null +++ b/application/default/views/scripts/news/index.phtml @@ -0,0 +1,67 @@ +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(' > '); +?> +
    +
    +
    +
    新闻分类
    + +
    +
    +
    +
    +
      + 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 '
    • + ['.$v['typetitle'].''.$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/list.phtml b/application/default/views/scripts/news/list.phtml new file mode 100644 index 00000000..bd8d8ad6 --- /dev/null +++ b/application/default/views/scripts/news/list.phtml @@ -0,0 +1,68 @@ +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 '
    • + '.$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 new file mode 100644 index 00000000..ad2852c0 --- /dev/null +++ b/application/default/views/scripts/news/search.phtml @@ -0,0 +1,11 @@ +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 diff --git a/application/models/CustomControllerAclManager.php b/application/models/CustomControllerAclManager.php index b9b35740..fc37c333 100755 --- a/application/models/CustomControllerAclManager.php +++ b/application/models/CustomControllerAclManager.php @@ -6,6 +6,7 @@ // the action to dispatch if a user doesn't have sufficient privileges private $_authController = array('module'=>'','controller' => 'account', 'action' => 'login'); + public function __construct(Zend_Auth $auth) { $this->db=Zend_Registry::get('db'); @@ -21,11 +22,13 @@ $this->acl->add(new Zend_Acl_Resource('water')); $this->acl->add(new Zend_Acl_Resource('admin')); $this->acl->add(new Zend_Acl_Resource('upload')); + $this->acl->add(new Zend_Acl_Resource('author')); // allow access to everything for all users by default // except for the account management and administration areas $this->acl->allow(); $this->acl->deny(null, 'account'); $this->acl->deny(null, 'admin'); + $this->acl->deny(null, 'author'); // add an exception so guests can log in or register // in order to gain privilege $this->acl->allow('guest', 'account', array('login', @@ -33,9 +36,12 @@ 'register', 'registercomplete')); $this->acl->deny('guest','data',array('download','order')); - $this->acl->deny('guest','water',array('download','order')); + $this->acl->deny('guest','water',array('download','order')); + // allow members access to the account management area + $this->acl->allow('guest','author',array('index')); $this->acl->allow('member', 'account'); + $this->acl->allow('member', 'author'); // allows administrators access to the admin area $this->acl->allow('administrator', 'admin'); } diff --git a/application/models/EmailText.php b/application/models/EmailText.php index 6bfe94c8..ae40722d 100644 --- a/application/models/EmailText.php +++ b/application/models/EmailText.php @@ -6,10 +6,10 @@ class EmailText{ protected $tmpinfo; function __construct($db,$id,$replace) - { - $this->db=$db; - $this->tmpid=$id; - $this->data=$replace; + { + $this->db=$db; + $this->tmpid=$id; + $this->data=$replace; $this->load(); } @@ -18,7 +18,7 @@ class EmailText{ if(is_numeric($this->tmpid)) $sql = "select * from emailtext where id='".$this->tmpid."'"; else - $sql = "select * from emailtext where template='".$this->tmpid."'"; + $sql = "select * from emailtext where template='".$this->tmpid."'"; $t=$this->db->getFetchMode(); $this->db->setFetchMode(Zend_Db::FETCH_ASSOC); $rs = $this->db->query($sql); @@ -33,10 +33,15 @@ class EmailText{ { return false; }else{ - if (empty($body)) - { - $this->getinfo(); - $body=$this->tmpinfo['body']; + if (empty($body)) + { + $this->getinfo(); + $body=$this->tmpinfo['body']; + } + + if (empty($this->tmpinfo['subject'])) + { + $this->getinfo(); } if(!empty($body)) @@ -56,7 +61,8 @@ class EmailText{ } ksort($patterns); ksort($replacements); - $this->tmpinfo['body']=preg_replace($patterns, $replacements, $body); + $this->tmpinfo['body'] = preg_replace($patterns, $replacements, $body); + $this->tmpinfo['subject'] = preg_replace($patterns, $replacements, $this->tmpinfo['subject']); return true; }//count($this->data) } @@ -65,11 +71,11 @@ class EmailText{ return false; } }//empty($this->tmpid) - }//function loadtmp - public function getBody() { - return $this->tmpinfo['body']; - } - public function getSubject() { - return $this->tmpinfo['subject']; + }//function loadtmp + public function getBody() { + return $this->tmpinfo['body']; + } + public function getSubject() { + return $this->tmpinfo['subject']; } } \ No newline at end of file diff --git a/application/models/ISO19115.php b/application/models/ISO19115.php index 17635b82..fde68f13 100755 --- a/application/models/ISO19115.php +++ b/application/models/ISO19115.php @@ -80,7 +80,7 @@ class ISO19115 public $mdContact; public $uuid; - public $doi; + public $doi=''; /** * 数据集标题 * 字符串 @@ -163,8 +163,154 @@ class ISO19115 function loadUUID($uuid) { } - function saveDB() + function saveDB($db,$xml) { + $this->loadXML($xml); + //先删除已有元数据,然后再插入新数据 + $sql="delete from metadata where uuid=?"; + $db->query($sql,array($this->uuid)); + //删除所有未用到的responsible数据 + $sql="delete from responsible where id not in (select distinct(resid) from role)"; + $db->query($sql); + + //if (!empty($this->doi)) $row->doi=$this->doi; + //生成空白统计数据,可以转移到数据库端处理(todo) + try + { + $sql="insert into mdstat (uuid) values(?)"; + $db->query($sql,array($this->uuid)); + } catch (Exception $e) { + //do nothing. + //说明数据库中已存在该信息 + } + + //save metadata into database + try { + $sql="insert into metadata (uuid,title,title_en,description,citation,suppinfo,fileformat,projection,datatype,filesize,ts_created, + timebegin,timeend,west,south,north,east,doi) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + $db->query($sql,array($this->uuid,$this->resTitle,$this->resAltTitle,$this->idAbs,$this->citation,$this->suppinfo,$this->fileformat, + $this->projection,$this->datatype,$this->filesize,$this->mdDateSt,$this->timebegin,$this->timeend,$this->geoBox['w'], + $this->geoBox['s'],$this->geoBox['n'],$this->geoBox['e'],$this->doi)); + $id=$db->lastInsertId('metadata','id'); + //处理在线资源 + if ($this->onlineresource) foreach($this->onlineresource as $resource) + { + $sql="insert into onlineresource (uuid,linkage,protocol,name,description) values(?,?,?,?,?)"; + $db->query($sql,array($this->uuid,$resource['linkage'],$resource['protocol'],$resource['name'],$resource['description'])); + } + //处理缩略图 + if (!empty($this->thumbnail)) { + $sql="insert into thumbnail (id,data,filetype) values(?,?,?)"; + $db->query($sql,array($id,$this->thumbnail,'jpg')); + } elseif ($this->graph) { + //$trow->data=$this->graph['data']; + $sql="select id as gid from geonetworkmetadata where uuid=?"; + $r=$db->fetchRow($sql,array($this->uuid)); + if ($r) + { + $thumb=base64_encode(file_get_contents($this->view->config->geonetwork->url.'srv/cn/resources.get?access=public&id='.$r->gid.'&fname='.urlencode($this->graph['filename']))); + $sql="insert into thumbnail (id,data,filetype,filedesc,filename) values(?,?,?,?,?)"; + $db->query($sql,array($id,$thumb,$this->graph['filetype'],$this->graph['filedesc'],$this->graph['filename'])); + } + } + //处理关键词 + //1:N relation + foreach($this->keyword as $keytype=>$keys) + { + foreach($keys as $key) + { + $sql="insert into keyword (id,keyword,keytype) values(?,?,?)"; + $db->query($sql,array($id,$key,$keytype)); + } + } + //处理数据集序列 + //M:N relation + if ($this->datasetSeries) foreach($this->datasetSeries as $ds) + { + $sql="select id from series where name=?"; + $sth=$db->prepare($sql); + $sth->execute(array($ds['seriesName'])); + $trow=$sth->fetch(); + if ($trow) + $sid=$trow->id; + else { + $sql="insert into series (name) values(?)"; + $db->query($sql,array($ds['seriesName'])); + $sid=$db->lastInsertId('series','id'); + } + $sql="insert into dataseries (id,sid) values(?,?)"; + $db->query($sql,array($id,$sid)); + } + //处理XML入库 + $sql="insert into xml (id,data) values(?,?)"; + $db->query($sql,array($id,$xml)); + //处理数据分类 + foreach($this->tpCat as $cat){ + if (is_numeric($cat)) { + $sql="insert into category (id,code) values(?,?)"; + $db->query($sql,array($id,(int)$cat)); + } else { + //是字符串,geonetwork会采用这种模式 + //从categorycode表中查找其对应的code + $sql="insert into category (id,code) select ?,code from categorycode where name=?"; + $db->query($sql,array($id, trim($cat))); + } + } + //处理联系人信息 + //先查询再进行处理 + //若用户信息发生变化,则存在问题 + //无法保证数据的更新状态 + foreach($this->author as $au) + { + $inds=explode(";",$au['individual']); + foreach($inds as $ind) + { + $sql="select id from responsible where individual=? and organisation=?"; + $row=$db->fetchRow($sql,array(trim($ind),trim($au['organisation']))); + if (!$row) + { + $sql="insert into responsible (individual,organisation,position,delivery,phone,email,city,country,administrative,postal) values(?,?,?,?,?,?,?,?,?,?)"; + $db->query($sql,array(trim($ind),trim($au['organisation']),trim($au['position']),trim($au['delivery']),trim($au['phone']),trim($au['email']),trim($au['city']),trim($au['country']),trim($au['administrative']),trim($au['postal']))); + } elseif (count($inds)==1) { + //deal email address + if (($au['email']) && empty($row->email)) + { + $sql="update responsible set email=? where id=?"; + $db->query($sql,array(trim($au['email']),$row->id)); + } + } + $sql="select id from responsible where individual=? and organisation=?"; + $row=$db->fetchRow($sql,array(trim($ind),trim($au['organisation']))); + if ($row->id>0) + { + $sql="insert into role (resid,uuid,role) values(?,?,?)"; + $db->query($sql,array($row->id,$this->uuid,trim($au['role']))); + } + } + } + //处理数据限制信息 + foreach($this->limits as $uselimit) + { + $sql="select id from uselimit where uselimit=?"; + $row=$db->fetchRow($sql,array($uselimit)); + if (!$row) + { + $sql="insert into uselimit (uselimit) values (?)"; + $db->query($sql,array($uselimit)); + } + $sql="select id from uselimit where uselimit=?"; + $row=$db->fetchRow($sql,array($uselimit)); + if ($row) + { + $sql="insert into mdlimit (uuid,lid) values(?,?)"; + $db->query($sql,array($this->uuid,$row->id)); + } + } + $this->save("../data/import/$this->uuid.xml"); + } catch (Exception $e) { + //数据重复插入,此处忽略所有错误 + print $this->uuid.' has error: '.$e->getMessage().'
    '; + } } function parse() diff --git a/application/models/ImgCode.php b/application/models/ImgCode.php new file mode 100644 index 00000000..67bb7a77 --- /dev/null +++ b/application/models/ImgCode.php @@ -0,0 +1,176 @@ +rand_string($length,$mode);//生成随机数 + + + //$authCode = new Zend_Session_Namespace('Auth_Code'); + //$authCode->imagecode = $randval;//生成session + + $_SESSION['vdcodes'] = strtolower($randval); + + $width = ($length*9+10)>$width?$length*9+10:$width; + if ( $type!='gif' && function_exists('imagecreatetruecolor')) { + $im = @imagecreatetruecolor($width,$height); + }else { + $im = @imagecreate($width,$height); + } + $r = Array(225,255,255,223); + $g = Array(225,236,237,255); + $b = Array(225,236,166,125); + $key = mt_rand(0,3); + + $backColor = imagecolorallocate($im, $r[$key],$g[$key],$b[$key]); //背景色(随机) + $borderColor = imagecolorallocate($im, 100, 100, 100); //边框色 + $pointColor = imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255)); //点颜色 + + @imagefilledrectangle($im, 0, 0, $width - 1, $height - 1, $backColor); + @imagerectangle($im, 0, 0, $width-1, $height-1, $borderColor); + $stringColor = imagecolorallocate($im,mt_rand(0,200),mt_rand(0,120),mt_rand(0,120)); + // 干扰 + for($i=0;$i<10;$i++){ + $fontcolor=imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255)); + imagearc($im,mt_rand(-10,$width),mt_rand(-10,$height),mt_rand(30,300),mt_rand(20,200),55,44,$fontcolor); + } + for($i=0;$i<25;$i++){ + $fontcolor=imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255)); + imagesetpixel($im,mt_rand(0,$width),mt_rand(0,$height),$pointColor); + } + + @imagestring($im, 5, 5, 3, $randval, $stringColor); + $this->output($im,$type); + } + + // 更复杂的验证码 + function image3($length=4,$type='png',$width=50,$height=60,$fontface='fpnf.ttf',$verifyName='verify') { + $code = $this->rand_string($length,4); + $width = ($length*25)>$width?$length*25:$width; + $authCode = new Zend_Session_Namespace('Auth_Code'); + $authCode->imagecode = $randval; + + $im=imagecreatetruecolor($width,$height); + $borderColor = imagecolorallocate($im, 100, 100, 100); //边框色 + $bkcolor=imagecolorallocate($im,250,250,250); + imagefill($im,0,0,$bkcolor); + @imagerectangle($im, 0, 0, $width-1, $height-1, $borderColor); + // 干扰 + for($i=0;$i<15;$i++){ + $fontcolor=imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255)); + imagearc($im,mt_rand(-10,$width),mt_rand(-10,$height),mt_rand(30,300),mt_rand(20,200),55,44,$fontcolor); + } + for($i=0;$i<255;$i++){ + $fontcolor=imagecolorallocate($im,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255)); + imagesetpixel($im,mt_rand(0,$width),mt_rand(0,$height),$fontcolor); + } + if(!is_file($fontface)) { + $fontface = dirname(__FILE__)."/".$fontface; + } + for($i=0;$i<$length;$i++){ + $fontcolor=imagecolorallocate($im,mt_rand(0,120),mt_rand(0,120),mt_rand(0,120)); //这样保证随机出来的颜色较深。 + $codex= substr($code,$i,1); + imagettftext($im,mt_rand(16,20),mt_rand(-60,60),40*$i+20,mt_rand(30,35),$fontcolor,$fontface,$codex); + } + $this->output($im,$type); + } + + function output($im,$type='png') + { + header("Content-type: image/".$type); + $ImageFun='Image'.$type; + $ImageFun($im); + imagedestroy($im); + } + + /** + +---------------------------------------------------------- + * 产生随机字串,可用来自动生成密码 默认长度6位 字母和数字混合 + +---------------------------------------------------------- + * @param string $len 长度 + * @param string $type 字串类型 + * 0 字母 1 数字 其它 混合 + * @param string $addChars 额外字符 + +---------------------------------------------------------- + * @return string + +---------------------------------------------------------- + */ + function rand_string($len=6,$type='',$addChars='') { + $str =''; + switch($type) { + case 0: + $chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.$addChars; + break; + case 1: + $chars= str_repeat('0123456789',3); + break; + case 2: + $chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ'.$addChars; + break; + case 3: + $chars='abcdefghijklmnopqrstuvwxyz'.$addChars; + break; + default : + // 默认去掉了容易混淆的字符oOLl和数字01,要添加请使用addChars参数 + $chars='ABCDEFGHIJKMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz23456789'.$addChars; + break; + } + if($len>10 ) {//位数过长重复字符串一定次数 + $chars= $type==1? str_repeat($chars,$len) : str_repeat($chars,5); + } + if($type!=4) { + $chars = str_shuffle($chars); + $str = substr($chars,0,$len); + }else{ + // 中文随机字 + for($i=0;$i<$len;$i++){ + $str.= substr($chars, floor(mt_rand(0,mb_strlen($chars,'utf-8')-1)),1); + } + } + return $str; + } + +} \ No newline at end of file diff --git a/application/models/LoginForm.php b/application/models/LoginForm.php index 4f17cba1..633b6f1e 100755 --- a/application/models/LoginForm.php +++ b/application/models/LoginForm.php @@ -1,50 +1,82 @@ -setName('login'); - - $username = new Zend_Form_Element_Text('username'); - $username->setLabel('用户名') - ->setRequired(true) - ->addFilter('StripTags') - ->addFilter('StringTrim') - ->addValidator('NotEmpty'); - - $password=new Zend_Form_Element_Password('password'); - $password->setLabel('密码')->setRequired(true); - - $remember=new Zend_Form_Element_Checkbox('remember'); - $remember->setLabel('记住我'); - $id = new Zend_Form_Element_Hidden('id'); - - $submit = new Zend_Form_Element_Submit('submit'); - $submit->setLabel('登录'); - $submit->setAttrib('id', 'submitbutton'); - - $this->addElements(array($id, $username, $password, $remember, $submit)); - $this->clearDecorators(); - $this->addDecorator('FormElements') - ->addDecorator('HtmlTag', array('tag' => '
      ','class'=>'loginform')) - ->addDecorator('Form'); - - $this->setElementDecorators(array( - array('ViewHelper'), - array('Errors'), - array('Description'), - array('Label', array('separator'=>' ')), - array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')), - )); - - // buttons do not need labels - $submit->setDecorators(array( - array('ViewHelper'), - array('Description'), - array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')), - )); - - } -} \ No newline at end of file +setName('login'); + + $username = new Zend_Form_Element_Text('username'); + $username->setLabel('用户名') + ->setRequired(true) + ->addFilter('StripTags') + ->addFilter('StringTrim') + ->addValidator('NotEmpty'); + + $password=new Zend_Form_Element_Password('password'); + $password->setLabel('密码')->setRequired(true); + + $remember=new Zend_Form_Element_Checkbox('remember'); + $remember->setLabel('记住我'); + + $id = new Zend_Form_Element_Hidden('id'); + + $submit = new Zend_Form_Element_Submit('submit'); + $submit->setLabel('登录'); + $submit->setAttrib('id', 'submitbutton'); + + $this->addElements(array($id, $username, $password, $remember)); + $this->clearDecorators(); + $this->addDecorator('FormElements') + ->addDecorator('HtmlTag', array('tag' => '
        ','class'=>'loginform')) + ->addDecorator('Form'); + + /* + $this->setElementDecorators(array( + array('ViewHelper'), + array('Errors'), + array('Description'), + array('Label', array('separator'=>' ')), + array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')), + )); + */ + + $captcha = $this->addElement('captcha', 'captcha', array( + 'captcha' => array( + // First the type... + 'captcha' => 'Image', + // Length of the word... + 'wordLen' => 4, + 'fontsize'=>16, + 'width' => 100, + 'height' => 38, + 'dotNoiseLevel'=>2, + 'lineNoiseLevel'=>1, + // Captcha timeout, 5 mins + 'timeout' => 300, + // What font to use... + 'font' => '../data/fonts/ggbi.ttf', + // Where to put the image + 'imgDir' => 'vdimg/', + // URL to the images + // This was bogus, here's how it should be... Sorry again :S + 'imgUrl' => '/vdimg', + ), + 'label' => '验证码' + )); + + /* + + // buttons do not need labels + $submit->setDecorators(array( + array('ViewHelper'), + array('Description'), + array('HtmlTag', array('tag' => 'li', 'class'=>'submit-group')), + )); + */ + + $this->addElements(array($submit)); + + } +} diff --git a/application/models/Proftp.php b/application/models/Proftp.php index 6908e12a..efc04392 100644 --- a/application/models/Proftp.php +++ b/application/models/Proftp.php @@ -37,11 +37,12 @@ class Proftp $sql="update ftpuser set pwd=?,ts_created=now(),ts_invalid=?,datacount=1 where userid=?"; $this->db->query($sql,array($user->password,$user->time,$user->id)); return true; - } elseif (strtotime($u['ts_invalid'])>time() && $u['datacount']<$user->maxdata) { + } elseif (strtotime($u['ts_invalid'])>time()/* && $u['datacount']<$user->maxdata*/) { //更新数据计数 - //use the old password - $sql="update ftpuser set ts_invalid=?,datacount=datacount+? where userid=?"; - $this->db->query($sql,array($user->time,$user->datacount,$user->id)); + //同步ftpuser和proftpusers用户密码 + $sql="update ftpuser set ts_invalid=?,datacount=datacount+?,pwd=proftpusers.passwd + from proftpusers where ftpuser.userid=? and proftpusers.userid=?"; + $this->db->query($sql,array($user->time,$user->datacount,$user->id,$user->username)); $sql="select pwd,ts_invalid from ftpuser where userid=?"; $u=$this->db->fetchRow($sql,array($user->id)); $this->pwd=$u['pwd']; diff --git a/application/models/member.php b/application/models/member.php index 4bf9e559..15162dba 100755 --- a/application/models/member.php +++ b/application/models/member.php @@ -41,6 +41,7 @@ class member else{ $sql = "select username,password from users where username='$uname'"; $rs = $this->db->query($sql); + $rs->setFetchMode(Zend_Db::FETCH_ASSOC); $row = $rs->fetch(); $scr = $this->makescr($row['username'],$row['password']);