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'],
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)
$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`))
intval($a->pager['start']), intval($a->pager['itemspage']));
}
- if(! count($r)) {
+ if (! dbm::is_result($r)) {
info( t('No results.') . EOL);
return $o;
}