add geonetwork url fix

This commit is contained in:
wlx 2012-04-15 09:41:02 +00:00
parent 2f316bfec8
commit 7e9a4f33e3
1 changed files with 6 additions and 1 deletions

View File

@ -172,6 +172,7 @@ class ISO19115
//删除所有未用到的responsible数据
$sql="delete from responsible where id not in (select distinct(resid) from role)";
$db->query($sql);
$this->view->config = Zend_Registry::get('config');
//if (!empty($this->doi)) $row->doi=$this->doi;
//生成空白统计数据可以转移到数据库端处理todo
@ -208,7 +209,11 @@ class ISO19115
$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'])));
if ($this->view->config)
$geonetwork=$this->view->config->geonetwork->url;
else
$geonetwork='/geonetwork/';
$thumb=base64_encode(file_get_contents($geonetwork.'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']));
}