#539, 实现heihe专题的在线、离线列表查看
This commit is contained in:
parent
7f529491da
commit
b71f0c79e9
|
@ -1239,4 +1239,34 @@ class HeiheController extends DataController
|
||||||
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
|
||||||
$this->view->paginator=$paginator;
|
$this->view->paginator=$paginator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onlinelistAction()
|
||||||
|
{
|
||||||
|
$page=(int)$this->_request->getParam('page');
|
||||||
|
if (empty($page)) $page=1;
|
||||||
|
$limit=30;
|
||||||
|
$offset=$limit*($page-1);
|
||||||
|
$state=$this->db->query("select count(*) from heihemetadata where datatype=0 and uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe')");
|
||||||
|
$row=$state->fetchAll();
|
||||||
|
$sum=$row[0]['count'];
|
||||||
|
$select=$this->db->select();
|
||||||
|
$select->from('heihemetadata','*')->where('datatype=0')->where("uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe')")->order('title')->limitPage($page,$limit);
|
||||||
|
$this->view->metadata = $this->db->fetchAll($select);
|
||||||
|
$this->view->page=new Pagination($sum,$page,$limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
function offlinelistAction()
|
||||||
|
{
|
||||||
|
$page=(int)$this->_request->getParam('page');
|
||||||
|
if (empty($page)) $page=1;
|
||||||
|
$limit=30;
|
||||||
|
$offset=$limit*($page-1);
|
||||||
|
$state=$this->db->query("select count(*) from heihemetadata where datatype=1 and uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe')");
|
||||||
|
$row=$state->fetchAll();
|
||||||
|
$sum=$row[0]['count'];
|
||||||
|
$select=$this->db->select();
|
||||||
|
$select->from('heihemetadata','*')->where('datatype=1')->where("uuid in (select ds.uuid from datasource ds left join source s on ds.sourceid=s.id where s.code='heihe')")->order('title')->limitPage($page,$limit);
|
||||||
|
$this->view->metadata = $this->db->fetchAll($select);
|
||||||
|
$this->view->page=new Pagination($sum,$page,$limit);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
$this->headTitle($this->config->title->site);
|
||||||
|
$this->headTitle($this->config->title->data);
|
||||||
|
$this->headTitle('离线数据浏览');
|
||||||
|
$this->headTitle()->setSeparator(' - ');
|
||||||
|
$this->nav[] = array('link'=>"/heihe/offline",'title'=>'离线数据浏览');
|
||||||
|
?>
|
||||||
|
<div class="row-fluid">
|
||||||
|
<?= $this->render('breadcrumbs.phtml'); ?>
|
||||||
|
</div>
|
||||||
|
<?php echo $this->page->getNavigation(); ?>
|
||||||
|
<hr />
|
||||||
|
<?php foreach($this->metadata as $md) : ?>
|
||||||
|
<div class="media well well-small">
|
||||||
|
<a href="/service/bigthumb/uuid/<?= $md['uuid'] ?>" class="pull-left colorbox">
|
||||||
|
<img class="media-object" src="/service/thumb/id/<?php echo $md['id'];?>">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading"><a href="/heihe/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a></h4>
|
||||||
|
<div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<hr />
|
||||||
|
<?php echo $this->page->getNavigation(); ?>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?php
|
||||||
|
$this->headTitle($this->config->title->site);
|
||||||
|
$this->headTitle($this->config->title->data);
|
||||||
|
$this->headTitle('在线数据浏览');
|
||||||
|
$this->headTitle()->setSeparator(' - ');
|
||||||
|
$this->nav[] = array('link'=>"/heihe/offline",'title'=>'在线数据浏览');
|
||||||
|
?>
|
||||||
|
<div>
|
||||||
|
<?= $this->render('breadcrumbs.phtml'); ?>
|
||||||
|
</div>
|
||||||
|
<?php echo $this->page->getNavigation(); ?>
|
||||||
|
<hr />
|
||||||
|
<?php foreach($this->metadata as $md) : ?>
|
||||||
|
<div class="media well well-small">
|
||||||
|
<a href="/service/bigthumb/uuid/<?= $md['uuid'] ?>" class="pull-left colorbox">
|
||||||
|
<img class="media-object" src="/service/thumb/id/<?php echo $md['id'];?>">
|
||||||
|
</a>
|
||||||
|
<div class="media-body">
|
||||||
|
<h4 class="media-heading"><a href="/heihe/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']);?></a></h4>
|
||||||
|
<div class="summary"><?php echo str_replace(array("\r\n", "\n", "\r"),'<br />',mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']));?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<hr />
|
||||||
|
<?php echo $this->page->getNavigation(); ?>
|
Loading…
Reference in New Issue