]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
refactored search suggestions and added forgotten sprintf.
authorRobin Millette <millette@controlyourself.ca>
Mon, 6 Apr 2009 01:14:59 +0000 (01:14 +0000)
committerRobin Millette <millette@controlyourself.ca>
Mon, 6 Apr 2009 01:14:59 +0000 (01:14 +0000)
actions/peoplesearch.php
lib/searchaction.php

index 6fbb19b882019328a87532c6b9808dbbbbeac7af..3ce719dd55c8645b73f3168cabb01af951000870 100644 (file)
@@ -82,25 +82,8 @@ class PeoplesearchAction extends SearchAction
         } else {
             $this->element('p', 'error', _('No results.'));
 
-            $qe = urlencode($q);
-            $message = _(<<<E_O_T
-* Make sure all words are spelled correctly.
-* Try different keywords.
-* Try more general keywords.
-* Try fewer keywords.
-
-You can also try your search on other engines:
-
-* [Twingly](http://www.twingly.com/search?q=$qe&content=microblog&site=identi.ca)
-* [Tweet scan](http://www.tweetscan.com/indexi.php?s=$qe)
-* [Google](http://www.google.com/search?q=site%3Aidenti.ca+$qe)
-* [Yahoo](http://search.yahoo.com/search?p=site%3Aidenti.ca+$qe)
-
-E_O_T
-);
-            $this->elementStart('div', 'blankfiller');
-            $this->raw(common_markup_to_html($message));
-            $this->elementEnd('div');
+//TODO
+            $this->searchSuggestions($q);
             $profile->free();
         }
     }
index c762db16f049a7f84f3bee989c78d41148b8d2f2..697262ccdb27cab5250b7e9d04859e767da78bf0 100644 (file)
@@ -133,5 +133,28 @@ class SearchAction extends Action
             $this->showResults($q, $page);
         }
     }
+
+    function searchSuggestions($q) {
+        $qe = urlencode($q);
+        $message = sprintf(_(<<<E_O_T
+* Make sure all words are spelled correctly.
+* Try different keywords.
+* Try more general keywords.
+* Try fewer keywords.
+
+You can also try your search on other engines:
+
+* [Twingly](http://www.twingly.com/search?q=%s&content=microblog&site=identi.ca)
+* [Tweet scan](http://www.tweetscan.com/indexi.php?s=%s)
+* [Google](http://www.google.com/search?q=site%%3Aidenti.ca+%s)
+* [Yahoo](http://search.yahoo.com/search?p=site%%3Aidenti.ca+%s)
+
+
+E_O_T
+), $qe, $qe, $qe, $qe);
+        $this->elementStart('div', 'blankfiller');
+        $this->raw(common_markup_to_html($message));
+        $this->elementEnd('div');
+    }
 }