aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dirsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-19 01:07:35 -0800
committerfriendica <info@friendica.com>2013-01-19 01:07:35 -0800
commitd8d8dd5ceda475f56a8c6ed2324f2eae94658d3a (patch)
tree0893d9745016c4c94fdc68e2f3493774e092cbe9 /mod/dirsearch.php
parent9725dcf41dce7b03828a29b7f6def11ef120a88f (diff)
downloadvolse-hubzilla-d8d8dd5ceda475f56a8c6ed2324f2eae94658d3a.tar.gz
volse-hubzilla-d8d8dd5ceda475f56a8c6ed2324f2eae94658d3a.tar.bz2
volse-hubzilla-d8d8dd5ceda475f56a8c6ed2324f2eae94658d3a.zip
directory services cleanup
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r--mod/dirsearch.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index b3b824b24..07af90ffb 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -4,7 +4,7 @@ require_once('include/dir_fns.php');
function dirsearch_init(&$a) {
- $a->set_pager_itemspage(60);
+ $a->set_pager_itemspage(80);
}
@@ -36,6 +36,8 @@ function dirsearch_content(&$a) {
$marital = ((x($_REQUEST,'marital')) ? $_REQUEST['marital'] : '');
$keywords = ((x($_REQUEST,'keywords')) ? $_REQUEST['keywords'] : '');
+// TODO - a meta search which joins all of these things to one search string
+
$sql_extra = '';
if($name)
@@ -61,12 +63,16 @@ function dirsearch_content(&$a) {
$page = (($_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
$startrec = (($page+1) * $perpage) - $perpage;
$limit = (($_REQUEST['limit']) ? intval($_REQUEST['limit']) : 0);
+ $return_total = ((x($_REQUEST,'return_total')) ? intval($_REQUEST['return_total']) : 0);
// ok a separate tag table won't work.
// merge them into xprof
$ret['success'] = true;
+ // If &limit=n, return at most n entries
+ // If &return_total=1, we count matching entries and return that as 'total_items' for use in pagination.
+ // By default we return one page (default 80 items maximum) and do not count total entries
if($limit)
$qlimit = " LIMIT $limit ";
@@ -80,9 +86,9 @@ function dirsearch_content(&$a) {
$order = " ORDER BY `xchan_name` ASC ";
$logic = ((strlen($sql_extra)) ? 0 : 1);
-dbg(1);
+
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra $order $qlimit ");
-dbg(0);
+
$ret['page'] = $page + 1;
$ret['records'] = count($r);