diff options
Diffstat (limited to 'actions/noticesearch.php')
-rw-r--r-- | actions/noticesearch.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 83e59dd9a..095d0a454 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -103,7 +103,7 @@ class NoticesearchAction extends SearchAction function showResults($q, $page) { $notice = new Notice(); - $q = strtolower($q); + $search_engine = $notice->getSearchEngine('identica_notices'); $search_engine->set_sort_mode('chron'); // Ask for an extra to see if there's more. @@ -114,20 +114,26 @@ class NoticesearchAction extends SearchAction $cnt = $notice->find(); } if ($cnt === 0) { - $this->element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results.')); + + $this->searchSuggestions($q); + if (common_logged_in()) { + $message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); + } + else { + $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q)); + } + + $this->elementStart('div', 'guide'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); return; } $terms = preg_split('/[\s,]+/', $q); $nl = new SearchNoticeList($notice, $this, $terms); - $cnt = $nl->show(); - - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'noticesearch', array('q' => $q)); - } - function isReadOnly() - { - return true; + $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, + $page, 'noticesearch', array('q' => $q)); } } |