Lines Matching refs:query
203 $query = $INPUT->arr('query');
204 $query['resultset'] = 'query';
205 $query['limit'] = 20;
206 $query['offset'] = $INPUT->int('query-offset');
207 $this->htmlSearchResults($query);
231 $query['limit'] = $this->commentLimit;
232 $query['offset'] = $INPUT->int('comment-offset');
233 $query['resultset'] = 'comment';
234 $this->htmlLatestItems($query);
236 $query['limit'] = $this->entryLimit;
237 $query['offset'] = $INPUT->int('entry-offset');
238 $query['resultset'] = 'entry';
239 $this->htmlLatestItems($query);
249 * @param array $query url parameters for query
251 private function htmlSearchResults($query) { argument
256 switch($query['filter']) {
282 if(isset($query['blog']) && $query['blog']) {
283 $where = 'WHERE blog = ' . $db->quote_string($query['blog']) . ' ';
288 if(isset($query['string']) && $query['string'] != '') {
289 switch($query['filter']) {
291 $where .= 'AND ( title LIKE \'%'.$db->escape_string($query['string']).'%\' ) ';
294 $where .= 'AND ( author LIKE \'%'.$db->escape_string($query['string']).'%\' ) ';
297 … $where .= 'AND ( comments.text LIKE \'%'.$db->escape_string($query['string']).'%\' ) ';
300 … $where .= 'AND ( comments.ip LIKE \'%'.$db->escape_string($query['string']).'%\' ) ';
303 … $where .= 'AND ( tags.tag LIKE \'%'.$db->escape_string($query['string']).'%\' ) ';
309 if(isset($query['pid']) && $query['pid'] != '') {
310 $where .= 'AND ( comments.pid = ' . $db->quote_string($query['pid']) . ' ) ';
317 $sqlselect .= ' LIMIT '.$query['limit'];
318 if($query['offset'] > 0) {
319 $sqlselect .= ' OFFSET '.$query['offset'];
322 $res = $db->query($sqlcount);
325 $resid = $db->query($sqlselect);
327 … $this->htmlShowPaginatedResult($resid, $query, $itemdisplaycallback, $count, $query['limit']);
335 * @param array $query Query parameters
343 private function htmlShowPaginatedResult($resid, $query, $itemdisplaycallback, $count, $limit) { argument
347 $currentpage = floor($query['offset'] / $limit) + 1;
356 $this->htmlPagination($query, $currentpage, $count, $limit);
359 call_user_func(array($this, $itemdisplaycallback), $items, $query);
369 $this->htmlPagination($query, $currentpage, $count, $limit);
376 * @param array $query Query parameters
383 private function htmlPagination($query, $currentpage, $maximum, $limit) { argument
409 … $this->htmlPaginationurl($query, ($currentpage - 2) * $limit, '«', $currentpage - 1);
420 $this->htmlPaginationurl($query, ($page - 1) * $limit, $page, $page);
426 $this->htmlPaginationurl($query, $currentpage * $limit, '»', $currentpage + 1);
435 * @param array $query Query parameters
441 private function htmlPaginationurl($query, $offset, $text, $title) { argument
443 list($params, $anchor) = $this->buildUrlParams($query, $offset);
450 * @param array $query Query parameters
454 private function buildUrlParams($query, $offset) { argument
458 $query['resultset'].'-offset' => $offset
460 $anchor = $query['resultset'] . '_latest';
462 if($query['resultset'] == 'query') {
465 'query[filter]' => $query['filter'],
466 'query[blog]' => $query['blog'],
467 'query[string]' => $query['string'],
468 'query[pid]' => $query['pid']
478 * @param array $query parameters
483 private function htmlLatestItems($query) { argument
484 $resultset = $query['resultset']; //query,comment,entry
486 …printf("<h2 id='{$resultset}_latest'>".$this->getLang($resultset.'_latest').'</h2>', $query['limit…
487 $this->htmlLimitForm($query);
509 $limit = $query['limit'];
511 if($query['offset']) {
512 $sqlselect .= ' OFFSET ' . $query['offset'];
515 $res = $this->sqlitehelper->getDB()->query($sqlcount);
518 $resid = $this->sqlitehelper->getDB()->query($sqlselect);
522 $this->htmlShowPaginatedResult($resid, $query, $itemdisplaycallback, $count, $limit);
529 * @param array $query parameters
533 private function htmlEntryList($entries, $query) { argument
546 $this->htmlEntryItem($entry, $query);
556 * @param array $query Query parameters
560 private function htmlEntryItem($entry, $query) { argument
571 … ptln('<td class="entry_set_blog">' . $this->htmlEntryEditForm($entry, $query, 'blog') . '</th>');
572 …ptln('<td class="entry_set_commentstatus">' . $this->htmlEntryEditForm($entry, $query, 'commentsta…
622 * @param array $query Query parameters
627 private function htmlCommentList($comments, $query) { argument
634 ptln('<input type="hidden" name="comment-offset" value="' .$query['offset']. '" />');
744 * @param array $query Query parameters
751 private function htmlEntryEditForm($entry, $query, $field = 'commentstatus') { argument
761 $form->addHidden('entry-offset', $query['offset']);
832 $query = $INPUT->arr('query');
833 …$form->addElement(form_makeListBoxField('query[blog]', $blogs, $query['blog'], $this->getLang('blo…
834 …ter]', ['entry_title', 'entry_author', 'comment', 'comment_ip', 'tags'], $query['filter'], $this->…
835 $form->addElement(form_makeTextField('query[string]', $query['string'],''));
847 * @param array $query Query parameters
851 private function htmlLimitForm($query) { argument
854 $resultset = $query['resultset'];
864 $query['limit'],
866 $form->addHidden($resultset . '-offset', $query['offset']);