X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fgroupsearch.php;h=7437166e6ae2a70698dbe015301ea9317ba6f070;hb=cbdf8e51aa2826e11cc17c34bcbf568ca37e26ce;hp=66f5c87b3fe670872a72e9e08dbe83cfc14a3c0d;hpb=aa100884fbfb7f14613f402b5eabdcd9637faf57;p=quix0rs-gnu-social.git diff --git a/actions/groupsearch.php b/actions/groupsearch.php index 66f5c87b3f..7437166e6a 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -1,9 +1,4 @@ show(); + $user_group->free(); + $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, + $page, 'groupsearch', array('q' => $q)); } else { - $this->element('p', 'error', _('No results')); + $this->element('p', 'error', _('No results.')); + $this->searchSuggestions($q); + if (common_logged_in()) { + $message = _('If you can\'t find the group you\'re looking for, you can [create it](%%action.newgroup%%) yourself.'); + } + else { + $message = sprintf(_('Why not [register an account](%%%%action.%s%%%%) and [create the group](%%%%action.newgroup%%%%) yourself!'), + (!common_config('site','openidonly')) ? 'register' : 'openidlogin'); + } + $this->elementStart('div', 'guide'); + $this->raw(common_markup_to_html($message)); + $this->elementEnd('div'); + $user_group->free(); } - $user_group->free(); - $this->pagination($page > 1, $cnt > GROUPS_PER_PAGE, - $page, 'groupsearch', array('q' => $q)); } } @@ -90,15 +97,15 @@ class GroupSearchResults extends GroupList { var $terms = null; var $pattern = null; - + function __construct($user_group, $terms, $action) { parent::__construct($user_group, $terms, $action); - $this->terms = array_map('preg_quote', + $this->terms = array_map('preg_quote', array_map('htmlspecialchars', $terms)); $this->pattern = '/('.implode('|',$terms).')/i'; } - + function highlight($text) { return preg_replace($this->pattern, '\\1', htmlspecialchars($text));