X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsearch.php;h=3de77a85c42d3b77de9f74c5b718e7277f20844b;hb=db2d0e009503539b134fd43837d440028d5b8de7;hp=a8372599916c4e574b0faca3e11fc1080184a651;hpb=7d531afd00de35ef55d0cc5caa63242765341dae;p=friendica.git diff --git a/mod/search.php b/mod/search.php index a837259991..3de77a85c4 100644 --- a/mod/search.php +++ b/mod/search.php @@ -15,9 +15,9 @@ function search_saved_searches() { intval(local_user()) ); - if(count($r)) { + if (dbm::is_result($r)) { $saved = array(); - foreach($r as $rr) { + foreach ($r as $rr) { $saved[] = array( 'id' => $rr['id'], 'term' => $rr['term'], @@ -53,7 +53,7 @@ function search_init(&$a) { intval(local_user()), dbesc($search) ); - if(! count($r)) { + if (! dbm::is_result($r)) { q("INSERT INTO `search` (`uid`,`term`) VALUES ( %d, '%s')", intval(local_user()), dbesc($search) @@ -209,7 +209,6 @@ function search_content(&$a) { $sql_extra = sprintf(" AND `item`.`body` REGEXP '%s' ", dbesc(protect_sprintf(preg_quote($search)))); } - $r = q("SELECT %s FROM `item` %s WHERE %s AND (`item`.`uid` = 0 OR (`item`.`uid` = %s AND NOT `item`.`global`)) @@ -220,7 +219,7 @@ function search_content(&$a) { intval($a->pager['start']), intval($a->pager['itemspage'])); } - if(! count($r)) { + if (! dbm::is_result($r)) { info( t('No results.') . EOL); return $o; }