#539, 实现heihe专题的在线、离线列表查看

This commit is contained in:
wlx 2013-07-14 09:58:14 +00:00
parent 7f529491da
commit b71f0c79e9
3 changed files with 80 additions and 0 deletions

View File

@ -1239,4 +1239,34 @@ class HeiheController extends DataController
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$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);
}
}

View File

@ -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(); ?>

View File

@ -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(); ?>