refactored search suggestions and added forgotten sprintf.

This commit is contained in:
Robin Millette 2009-04-06 01:14:59 +00:00
parent 1ee24a2aaf
commit 84d2aa7df4
2 changed files with 25 additions and 19 deletions

View File

@ -82,25 +82,8 @@ class PeoplesearchAction extends SearchAction
} else { } else {
$this->element('p', 'error', _('No results.')); $this->element('p', 'error', _('No results.'));
$qe = urlencode($q); //TODO
$message = _(<<<E_O_T $this->searchSuggestions($q);
* 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');
$profile->free(); $profile->free();
} }
} }

View File

@ -133,5 +133,28 @@ class SearchAction extends Action
$this->showResults($q, $page); $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');
}
} }