修复在线数据的下载问题

This commit is contained in:
wlx 2013-05-26 12:08:28 +00:00
parent 3af3b545ee
commit 63bed29856
2 changed files with 23 additions and 33 deletions

View File

@ -1284,6 +1284,7 @@ class DataController extends Zend_Controller_Action
{
$uuid=$this->_request->getParam('uuid');
$onlineappid=$this->_request->getParam('onlineappid');
$this->view->pageID = "account-dataorder";
if (empty($uuid)) $this->_redirect('/data');
@ -1330,6 +1331,8 @@ class DataController extends Zend_Controller_Action
$this->view->md=$data;
$this->view->userpass=md5('westdc'.rand(1000,9999));
$this->view->ftptime=date('Y-m-d H:i:s', strtotime('+1 week'));
$sql=$this->db->quoteInto("select * from ftpuser where userid=?",$userid);
$row=$this->db->fetchRow($sql);
$datacount=$row['datacount'];
if ($data['host']=='ftp.westgis.ac.cn')
{
@ -1398,7 +1401,7 @@ class DataController extends Zend_Controller_Action
//设置输出
//if ($updateftp || $updateftp1) $this->view->userpass=$password;
$this->view->ftpurls=$ftpurl;
$this->view->ftpurl=$ftpurl;
//更新下载记录
//todo: 尝试添加一个RULE若有对应数据存在则不插入 userid,uuid,status=0,ts_approved:null)
/*$sql="select * from dataorder where userid=? and uuid=? and status=0 and (ts_approved is null)";

View File

@ -3,51 +3,38 @@
$this->headTitle($this->config->title->data);
$this->headTitle('下载');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/download.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('下载');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id="download">
<div class="row">
<div class="span3">
<div class="well sidebar-nav">
<?= $this->partial('account/left.phtml'); ?>
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
<h1><?php echo $this->md['title']; ?>(<?php echo $this->md['filesize']; ?>MB)</h1>
<div id="thumb"><img src="/service/thumb/id/<?php echo $this->md['id'];?>" /></div>
<div id="ftpurl">
<fieldset><legend>FTP下载地址</legend>
<ul>
<?php if ($this->ftpurls) : ?>
<?php foreach($this->ftpurls as $ftp) : ?>
<li><a href="<?php echo $ftp; ?>"><?php echo $ftp; ?></a></li>
<?php endforeach; endif;?>
<?php if ($this->ftpurl) : ?>
<li><a href="<?php echo $this->ftpurl; ?>"><?php echo $this->ftpurl; ?></a></li>
<?php endif;?>
</ul>
</fieldset>
</div>
<div id="link">
<?php if ($this->links) : ?>
<fieldset><legend>其他在线资源</legend>
<ul><?php foreach($this->links as $link) : ?>
<li><a href="<?php echo $link['linkage']; ?>">
<?php
if (!empty($link['name']))
echo $link['name'];
elseif (!empty($link['description']))
echo $link['description'];
else
echo $link['linkage'];
?></a></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</fieldset>
</div>
<div id="ftpinfo">
<fieldset><legend>FTP使用说明</legend>
帐号信息如下:<ul><li>FTP的用户名<?php echo $this->username; ?></li>
<li>FTP的密码<?php echo $this->userpass; ?></li>
<li>密码有效期限:<?php echo $this->ftptime; ?></li>
</ul>
<p>FTP是一种常用的文件传输协议西部数据中心推荐您使用使用开源的<a href="http://filezilla-project.org">FileZilla</a>软件来进行数据下载您可以使用您自己喜欢的FTP客户端来进行数据下载。</p>
<?php if ($this->md['host']=='ftp.westgis.ac.cn') : ?>
<p class="text-error">请注意此FTP需要在登陆后手工输入目录地址</p>
<?php endif; ?>
<p>FTP是一种常用的文件传输协议西部数据中心推荐您使用使用开源的<a href="http://filezilla-project.org">FileZilla</a>软件来进行数据下载您也可以使用您自己喜欢的FTP客户端来进行数据下载。</p>
<p>在使用FTP中遇到问题可以参考<a href="/archives/news/localnews/archive-7.html">数据的FTP下载问题</a></p>
<img src="/images/filezilla-westdc.png" alt="以FileZilla演示如何下载数据" />
</fieldset>
</div>
</div>
</div>