X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fpeoplesearch.php;h=65d970dd159a7fea183763d9fd8488fdde4cb2ab;hb=68b34b32667025b6d3ab74c0a6b5b356d1f24b10;hp=14177fcf0d48cb996fb77d11f69e65104b9675c4;hpb=61940e37ff89710628eff1a4ad6db8df16142cec;p=quix0rs-gnu-social.git diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 14177fcf0d..65d970dd15 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -60,16 +60,10 @@ class PeoplesearchAction extends SearchAction function showResults($q, $page) { - $profile = new Profile(); - - # lcase it for comparison - $q = strtolower($q); - $search_engine = $profile->getSearchEngine('identica_people'); - $search_engine->set_sort_mode('chron'); - # Ask for an extra to see if there's more. + // Ask for an extra to see if there's more. $search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1); if (false === $search_engine->query($q)) { $cnt = 0; @@ -81,14 +75,15 @@ class PeoplesearchAction extends SearchAction $terms = preg_split('/[\s,]+/', $q); $results = new PeopleSearchResults($profile, $terms, $this); $results->show(); + $profile->free(); + $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE, + $page, 'peoplesearch', array('q' => $q)); + } else { - $this->element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results.')); + $this->searchSuggestions($q); + $profile->free(); } - - $profile->free(); - - $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE, - $page, 'peoplesearch', array('q' => $q)); } }