From 1f965f1b701ab3850e0914e4333ff23b82274109 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 1 Oct 2013 19:04:08 -0700 Subject: search_ac is really whacked - help it out a bit, but much more to do --- mod/search_ac.php | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/mod/search_ac.php b/mod/search_ac.php index 21ff1c9f3..8e87f8449 100644 --- a/mod/search_ac.php +++ b/mod/search_ac.php @@ -30,22 +30,22 @@ function search_ac_init(&$a){ $people_sql_extra = protect_sprintf(" AND `name` LIKE '%". dbesc($search) . "%' "); $tag_sql_extra = protect_sprintf(" AND term LIKE '%". dbesc($search) . "%' "); } - - $r = q("SELECT `id`, `name`, `micro`, `url` FROM `contact` - WHERE `uid` = %d AND `pending` = 0 - $people_sql_extra - ORDER BY `name` ASC ", - intval(local_user()) - ); - - if(count($r)) { - foreach($r as $g) { - $x['photos'][] = $g['micro']; - $x['links'][] = $g['url']; - $x['suggestions'][] = '@' . $g['name']; - $x['data'][] = intval($g['id']); - } - } +// FIXME - this is whacked +// $r = q("SELECT `id`, `name`, `micro`, `url` FROM `contact` +// WHERE `uid` = %d AND `pending` = 0 +// $people_sql_extra +// ORDER BY `name` ASC ", +// intval(local_user()) +// ); + +// if($r) { +// foreach($r as $g) { +// $x['photos'][] = $g['micro']; +// $x['links'][] = $g['url']; +// $x['suggestions'][] = '@' . $g['name']; +// $x['data'][] = intval($g['id']); +// } +// } // FIXME - extend search to non-connnections if you couldn't find any connections with that name, use poco or directory // else { // @@ -64,7 +64,7 @@ function search_ac_init(&$a){ // } // } - $r = q("select tid, term, url from term where type = %d $tag_sql_extra order by term asc", + $r = q("select distinct term, tid, url from term where type = %d $tag_sql_extra group by term order by term asc", intval(TERM_HASHTAG) ); -- cgit v1.2.3