diff --git a/application/default/controllers/SearchController.php b/application/default/controllers/SearchController.php index 353d57c9..37f172af 100644 --- a/application/default/controllers/SearchController.php +++ b/application/default/controllers/SearchController.php @@ -40,6 +40,33 @@ class SearchController extends Zend_Controller_Action header("Content-Type: application/json; charset=utf-8"); echo $search->suggest($q); } + + function hotAction() + { + $sql="select m.uuid,title from normalmetadata m left join mdstat s on m.uuid=s.uuid order by s.viewed desc limit 10"; + $sth = $this->db->prepare($sql); + $sth ->execute(); + $rows = $sth->fetchAll(); + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + header("Content-Type: application/json; charset=utf-8"); + echo json_encode($rows);; + } + + function latestAction() + { + $sql="select uuid,title from normalmetadata order by ts_created desc limit 10"; + $sth = $this->db->prepare($sql); + $sth ->execute(); + $rows = $sth->fetchAll(); + + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + header("Content-Type: application/json; charset=utf-8"); + echo json_encode($rows);; + } + function advanceAction() { $this->view->east=$this->getParam('east');