调整了缩略图显示方式,并添加了点击显示大图功能

This commit is contained in:
wlx 2011-10-25 04:12:44 +00:00
parent d13c206b1e
commit fabcd090aa
2 changed files with 19 additions and 5 deletions

View File

@ -36,11 +36,15 @@ class HeiheController extends DataController
$page=(int)$this->_request->getParam('page');
if (empty($page)) $page=1;
$offset=$this->limit*($page-1);
$state=$this->db->query("select count(*) from metadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'");
$state=$this->db->query("select count(*) from normalmetadata where source='e3ad32dc-f573-11e0-aa7b-b768cfd88d80'");
$row=$state->fetchAll();
$sum=$row[0]['count'];
$select=$this->db->select();
$select->from('metadata','*')->where("source=?",'e3ad32dc-f573-11e0-aa7b-b768cfd88d80')->order('title desc')->limitPage($page,$this->limit);
$select->from('normalmetadata as m','m.*')
->joinLeft('heihegn as g','g.uuid=m.uuid','g.id as gid')
->joinLeft('thumbnail as t','t.id=m.id','t.filename')
->where("m.source=?",'e3ad32dc-f573-11e0-aa7b-b768cfd88d80')
->order('m.title desc')->limitPage($page,$this->limit);
$this->view->metadata = $this->db->fetchAll($select);
$this->view->page=new Pagination($sum,$page,$this->limit);
}

View File

@ -4,6 +4,7 @@
$this->headTitle('全部浏览');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->headScript()->appendFile('/js/pubfunc.js');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/data">'.$this->config->title->data.'</a>');
$this->breadcrumb('<a href="/heihe">数字黑河</a>');
@ -19,10 +20,19 @@ $this->breadcrumb()->setSeparator(' > ');
<?php echo $this->page->getNavigation(); ?>
<hr />
<div id="mdlist">
<?php foreach($this->metadata as $md) : ?>
<?php foreach($this->metadata as $md) :
$thumburl='/gndata/'.sprintf('%05d',floor(($md['gid']+0.1)/100)*100).'-'.sprintf('%05d',ceil(($md['gid']+0.1)/100)*100-1)."/".$md['gid'];
$thumburl.='/public/'.str_replace('_s.','.',$md['filename']);
?>
<div class="thumb">
<a href="/heihe/view/uuid/<?php echo $md['uuid'];?>">
<img src="/data/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"/></a>
<div class="thumbtitle">
<a href="/heihe/view/uuid/<?php echo $md['uuid'];?>"><?php echo $this->escape($md['title']); ?> </a>
</div>
<img src="/data/thumb/id/<?php echo $md['id'];?>" alt="<?php echo $this->escape($md['title']);?>" title="<?php echo mb_strlen($md['description'])>400?$this->escape(mb_substr($md['description'],0,400,'UTF-8').'...'):$this->escape($md['description']);?>"
onclick="fnCreate('http://qa.magicfind.net<?php echo $thumburl; ?>')" />
</div>
<?php endforeach; ?>
</div>