X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fmsearch.php;h=14dfd1ef7c1646caf7bfde3bd5f2b269360f196b;hb=a5cce36c44c83cb0f42b9a5c760f6e78629d898f;hp=48476da4f06542a00d3c101202233c4e035d7543;hpb=e80d68ba53776bed047d897f52db7e25b35a479d;p=friendica.git diff --git a/mod/msearch.php b/mod/msearch.php index 48476da4f0..14dfd1ef7c 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -45,7 +45,7 @@ function msearch_post(App $a) "SELECT COUNT(*) AS `total` FROM `profile` JOIN `user` ON `user`.`uid` = `profile`.`uid` - WHERE `user`.`hidewall` = 0 + WHERE `profile`.`net-publish` AND MATCH(`pub_keywords`) AGAINST (?)", $search ); @@ -60,7 +60,7 @@ function msearch_post(App $a) "SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` JOIN `profile` ON `user`.`uid` = `profile`.`uid` - WHERE `user`.`hidewall` = 0 + WHERE `profile`.`net-publish` AND MATCH(`pub_keywords`) AGAINST (?) LIMIT ?, ?", $search, @@ -68,7 +68,7 @@ function msearch_post(App $a) $perpage ); - while($search_result = DBA::fetch($search_stmt)) { + while ($search_result = DBA::fetch($search_stmt)) { $results[] = [ 'name' => $search_result['name'], 'url' => DI::baseUrl() . '/profile/' . $search_result['nickname'], @@ -77,6 +77,8 @@ function msearch_post(App $a) ]; } + DBA::close($search_stmt); + $output = ['total' => $total, 'items_page' => $perpage, 'page' => $page, 'results' => $results]; echo json_encode($output);