$o = '';
$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');
- if (! Feature::isEnabled(local_user(),'savedsearch'))
+ if (!Feature::isEnabled(local_user(),'savedsearch'))
return $o;
$r = q("SELECT `id`,`term` FROM `search` WHERE `uid` = %d",
dba::delete('search', ['uid' => local_user(), 'term' => $search]);
}
+ /// @todo Check if there is a case at all that "aside" is prefilled here
+ if (!isset($a->page['aside'])) {
+ $a->page['aside'] = '';
+ }
+
$a->page['aside'] .= search_saved_searches();
} else {
break;
}
- if (! $search)
+ if (!$search)
return $o;
if (Config::get('system','only_tag_search'))
}
dba::close($terms);
- $items = Item::selectForUser(local_user(), [], ['id' => array_reverse($itemids)]);
- $r = dba::inArray($items);
+ if (!empty($itemids)) {
+ $params = ['order' => ['id' => true]];
+ $items = Item::selectForUser(local_user(), [], ['id' => $itemids], $params);
+ $r = Item::inArray($items);
+ } else {
+ $r = [];
+ }
} else {
logger("Start fulltext search for '".$search."'", LOGGER_DEBUG);
$params = ['order' => ['id' => true],
'limit' => [$a->pager['start'], $a->pager['itemspage']]];
$items = Item::selectForUser(local_user(), [], $condition, $params);
- $r = dba::inArray($items);
+ $r = Item::inArray($items);
}
if (!DBM::is_result($r)) {
return $o;
}
-