diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 89bae970..382c44c5 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1342,22 +1342,17 @@ class DataController extends Zend_Controller_Action */ function thumbAction() { - $id = (int)$this->_request->getParam('id'); - if ($id>0) { - $thumb=$this->db->fetchRow($this->db->quoteInto('select * from thumbnail where id=?',$id)); - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - if (empty($thumb['data'])) { - header("Content-Type:image/png"); - header("Content-Length: " . filesize("images/nothumb.png")); - $file=fopen("images/nothumb.png",'r'); - fpassthru($file); - exit; - } else { - header("Content-Type:image/".$thumb['filetype']); - print base64_decode($thumb['data']); - } - } + $page=(int)$this->_request->getParam('page'); + if (empty($page)) $page=1; + $offset=$this->limit*($page-1); + $state=$this->db->query("select count(*) from normalmetadata"); + $row=$state->fetchAll(); + $sum=$row[0]['count']; + $select=$this->db->select(); + $select->from('normalmetadata as m','m.*') + ->order('m.title desc')->limitPage($page,$this->limit); + $this->view->metadata = $this->db->fetchAll($select); + $this->view->page=new Pagination($sum,$page,$this->limit); } /* diff --git a/application/default/views/scripts/data/index.phtml b/application/default/views/scripts/data/index.phtml index 687919b3..111f9db5 100755 --- a/application/default/views/scripts/data/index.phtml +++ b/application/default/views/scripts/data/index.phtml @@ -50,7 +50,9 @@ if (is_array($kcg) && count($kcg)>0 ) :