diff --git a/mod/qsearch.php b/mod/qsearch.php new file mode 100644 index 0000000000..e61915c758 --- /dev/null +++ b/mod/qsearch.php @@ -0,0 +1,49 @@ +',''); + } + + $sql_extra = ((strlen($search)) ? " AND (`name` REGEXP '$search' OR `nick` REGEXP '$search') " : ""); + + + $r = q("SELECT * FROM `contact` WHERE `uid` = %d $sql_extra ORDER BY `name` ASC LIMIT 0, %d ", + intval(local_user()), + intval($limit) + ); + + + if(count($r)) { + + foreach($r as $rr) + $results[] = array($rr['name'],$rr['url'],$rr['photo']); + } + + echo str_replace('\\/','/',json_encode((object) $results)); + killme(); +} \ No newline at end of file