From 833d51527b7cf852f519ea29c6bf20bc25a3d717 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Thu, 8 Jan 2015 16:05:00 +0100 Subject: Honor requested count in navbar search --- mod/acl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod') diff --git a/mod/acl.php b/mod/acl.php index f575db55b..d406942c3 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -293,9 +293,10 @@ function navbar_complete(&$a) { $url = $directory['url'] . '/dirsearch'; } + $count = (x($_REQUEST,'count')?$_REQUEST['count']:100); if($url) { $query = $url . '?f=' ; - $query .= '&name=' . urlencode($search) . '&limit=50' . (($address) ? '&address=' . urlencode($search) : ''); + $query .= '&name=' . urlencode($search) . "&limit=$count" . (($address) ? '&address=' . urlencode($search) : ''); $x = z_fetch_url($query); if($x['success']) { -- cgit v1.2.3 From 32c6eab01c820c0ab44aa1b8860bf3173061e4e2 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Thu, 8 Jan 2015 17:16:08 +0100 Subject: Fix saved searches on network page, fix caching mith multiple autocompleters --- mod/search_ac.php | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'mod') diff --git a/mod/search_ac.php b/mod/search_ac.php index 36da21376..b4f5c9600 100644 --- a/mod/search_ac.php +++ b/mod/search_ac.php @@ -1,8 +1,9 @@ $g['xchan_photo_s'], + "name" => '@'.$g['xchan_name'], + "id" => $g['abook_id'], + "link" => $g['xchan_url'], + "label" => '', + "nick" => '', + ); } } @@ -53,15 +48,24 @@ function search_ac_init(&$a){ if(count($r)) { foreach($r as $g) { - $x['photos'][] = $a->get_baseurl() . '/images/hashtag.png'; - $x['links'][] = $g['url']; - $x['suggestions'][] = '#' . $g['term']; - $x['data'][] = intval($g['tid']); + $results[] = array( + "photo" => $a->get_baseurl() . '/images/hashtag.png', + "name" => '#'.$g['term'], + "id" => $g['tid'], + "link" => $g['url'], + "label" => '', + "nick" => '', + ); } } header("content-type: application/json"); - echo json_encode($x); + $o = array( + 'start' => $start, + 'count' => $count, + 'items' => $results, + ); + echo json_encode($o); logger('search_ac: ' . print_r($x,true)); -- cgit v1.2.3