]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/peoplesearch.php
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into...
[quix0rs-gnu-social.git] / actions / peoplesearch.php
index 9e515ade1a9e7b6d21bab32f18e3e9cf44bc5677..65d970dd159a7fea183763d9fd8488fdde4cb2ab 100644 (file)
@@ -60,14 +60,8 @@ 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.
         $search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
@@ -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));
     }
 }