public function search_frontend($f3) { $this->response->data['SUBPART'] = 'payload_list.html'; $page = \Pagination::findCurrentPage(); $term = $f3->get('GET.term'); $search_filter = array('pName LIKE ? OR pDescription LIKE ? OR payload LIKE ? OR pCategory LIKE ? ', "%{$term}%", "%{$term}%", "%{$term}%", "%{$term}%"); $records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc')); $this->response->data['content'] = $records; }
/** * Returns index page for logs with pagination */ public function index() { $page = \Pagination::findCurrentPage(); $result = $this->model->paginate($page - 1, $this->app->get('limit'), [], ['order' => self::ORDER]); $pages = new Pagination($result['total'], $result['limit']); $pages->setTemplate('../views/pagebrowser.html'); $this->app->set('pagebrowser', $pages->serve()); $this->app->set('logs', $result); echo Template::instance()->render('../views/logs.htm'); }
function do_list($f3, $args) { $subset = fPress::load_list(Pagination::findCurrentPage(), $args['slug']); $cate = array(); foreach ($subset['subset'] as &$row) { $cate[$row->category_id] = rCategory::breadcrumb_categories($row->category_id); $f3->set('act_link', str_replace('/', '', $cate[$row->category_id]['slug'])); } $f3->set('pagebrowser', parent::paginate($subset['total'], $subset['limit'], '/presses/' . $args['slug'])); $f3->set('rows', $subset); $f3->set('cate', $cate); parent::wrapper('press/list.html', '展覽、文章', '/presses'); }
/** * display a list of post entries * @param \Base $f3 * @param array $params */ public function getList(\Base $f3, $params) { $this->response->data['SUBPART'] = 'post_list.html'; $page = \Pagination::findCurrentPage(); if ($this->response instanceof \View\Backend) { // backend view $records = $this->resource->paginate($page - 1, 5, null, array('order' => 'publish_date desc')); } else { // frontend view $tags = new Tag(); $f3->set('tag_cloud', $tags->tagCloud()); $this->resource->filter('comments', array('approved = ?', 1)); $this->resource->countRel('comments'); $records = $this->resource->paginate($page - 1, 10, array('publish_date <= ? and published = ?', date('Y-m-d'), true), array('order' => 'publish_date desc')); } $this->response->data['content'] = $records; }
/** * display list of comments * @param \Base $f3 * @param array $params */ public function getList(\Base $f3, $params) { $this->response->data['SUBPART'] = 'comment_list.html'; $filter = array('approved = ?', 0); // new if (isset($params['viewtype'])) { if ($params['viewtype'] == 'published') { $filter = array('approved = ?', 1); } elseif ($params['viewtype'] == 'rejected') { $filter = array('approved = ?', 2); } elseif (!empty($params['viewtype'])) { // display all comments for a specified post $filter = array('post = ?', $params['viewtype']); } } $page = \Pagination::findCurrentPage(); $limit = 10; $this->response->data['comments'] = $this->resource->paginate($page - 1, $limit, $filter, array('order' => 'datetime desc')); }
/** * @param $f3 */ public function getSearchResults($f3) { $this->response->data['SUBPART'] = 'webot_list.html'; $page = \Pagination::findCurrentPage(); $term = $f3->get('GET.term'); $search_filter = array('zName LIKE ? zParam LIKE ? ', "%{$term}%", "%{$term}%"); $records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc')); $this->response->data['content'] = $records; }
public function getSearchResults($f3) { $this->response->data['SUBPART'] = 'ctdb_list.html'; $page = \Pagination::findCurrentPage(); $term = $f3->get('GET.term'); $search_filter = array('hosttag LIKE ? OR vulnerableUrl LIKE ? OR referer LIKE ? ', "%{$term}%", "%{$term}%", "%{$term}%"); $records = $this->resource->paginate($page - 1, 10, $search_filter, array('order' => 'id desc')); $this->response->data['content'] = $records; }