From d1b2a9d7087ecc171f941755b4c3a420cd202842 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 Mar 2009 11:01:58 -0400 Subject: Somewhat better behaviour with mixed caps in search Deal somewhat better with mixed caps in people and notice search. --- actions/groupsearch.php | 11 +++-------- actions/noticesearch.php | 2 +- actions/noticesearchrss.php | 3 --- actions/peoplesearch.php | 6 +++--- 4 files changed, 7 insertions(+), 15 deletions(-) (limited to 'actions') diff --git a/actions/groupsearch.php b/actions/groupsearch.php index 9b0026db9..109a53ce1 100644 --- a/actions/groupsearch.php +++ b/actions/groupsearch.php @@ -1,9 +1,4 @@ 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)); diff --git a/actions/noticesearch.php b/actions/noticesearch.php index 83e59dd9a..eb4a072de 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. diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index 0f98ed04b..ba5276d06 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -62,9 +62,6 @@ class NoticesearchrssAction extends Rss10Action $notice = new Notice(); - # lcase it for comparison - $q = strtolower($q); - $search_engine = $notice->getSearchEngine('identica_notices'); $search_engine->set_sort_mode('chron'); diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 14177fcf0..9e515ade1 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -63,13 +63,13 @@ class PeoplesearchAction extends SearchAction $profile = new Profile(); - # lcase it for comparison - $q = strtolower($q); + // 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. + // Ask for an extra to see if there's more. $search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1); if (false === $search_engine->query($q)) { $cnt = 0; -- cgit v1.2.3-54-g00ecf From 3d8a8aa03c7672966006aa0b7be5da699decbcb3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 Mar 2009 11:36:24 -0400 Subject: redirect to original URL or URI for remote notices --- actions/shownotice.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'actions') diff --git a/actions/shownotice.php b/actions/shownotice.php index d5f35cd84..ccae49bb3 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -177,10 +177,17 @@ class ShownoticeAction extends Action { parent::handle($args); - $this->showPage(); + if ($this->notice->is_local == 0) { + if (!empty($this->notice->url)) { + common_redirect($this->notice->url, 301); + } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { + common_redirect($this->notice->uri, 301); + } + } else { + $this->showPage(); + } } - /** * Don't show local navigation * @@ -191,7 +198,6 @@ class ShownoticeAction extends Action { } - /** * Fill the content area of the page * @@ -208,8 +214,6 @@ class ShownoticeAction extends Action $this->elementEnd('ul'); } - - /** * Don't show page notice * @@ -220,7 +224,6 @@ class ShownoticeAction extends Action { } - /** * Don't show aside * @@ -230,7 +233,6 @@ class ShownoticeAction extends Action function showAside() { } - /** * Extra content * -- cgit v1.2.3-54-g00ecf From 0e1186dfd0e96a64688c107f28a93b1ef172f56a Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 19 Mar 2009 18:08:49 +0000 Subject: Get rid of 'Join now...' message if site is closed or invite only. See ticket #1335 --- actions/public.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'actions') diff --git a/actions/public.php b/actions/public.php index a20ae4032..9b22e0a2c 100644 --- a/actions/public.php +++ b/actions/public.php @@ -207,9 +207,14 @@ class PublicAction extends Action function showAnonymousMessage() { - $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . - '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); + if (! (common_config('site','closed') || common_config('site','inviteonly'))) { + $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . + '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))'); + } else { + $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool.'); + } $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); -- cgit v1.2.3-54-g00ecf From b4c273113cc5d16dfa1ea3236dd8c78d1169cbf3 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 19 Mar 2009 21:55:03 +0000 Subject: A couple more 'Join Now' messages that need disabling when the site is closed or invite only --- actions/showgroup.php | 15 +++++++++++---- actions/showstream.php | 14 ++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'actions') diff --git a/actions/showgroup.php b/actions/showgroup.php index b6022840b..58cc7a97c 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -390,11 +390,18 @@ class ShowgroupAction extends Action function showAnonymousMessage() { - $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . - 'short messages about their life and interests. '. - '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), + if (!(common_config('site','closed') || common_config('site','inviteonly'))) { + $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . + 'short messages about their life and interests. '. + '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'), $this->group->nickname); + } else { + $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' . + 'short messages about their life and interests. '), + $this->group->nickname); + } $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); diff --git a/actions/showstream.php b/actions/showstream.php index 65482167e..b83f45d53 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -539,10 +539,16 @@ class ShowstreamAction extends Action function showAnonymousMessage() { - $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . - 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . - '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'), - $this->user->nickname, $this->user->nickname); + if (!(common_config('site','closed') || common_config('site','inviteonly'))) { + $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' . + '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'), + $this->user->nickname, $this->user->nickname); + } else { + $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' . + 'based on the Free Software [Laconica](http://laconi.ca/) tool. '), + $this->user->nickname, $this->user->nickname); + } $this->elementStart('div', array('id' => 'anon_notice')); $this->raw(common_markup_to_html($m)); $this->elementEnd('div'); -- cgit v1.2.3-54-g00ecf From a9a71297f4c915c11e573adafffeccf3ff65a31c Mon Sep 17 00:00:00 2001 From: CiaranG Date: Fri, 20 Mar 2009 22:02:35 +0000 Subject: Use correct page information for notice search. See ticket #1333 --- actions/noticesearch.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/noticesearch.php b/actions/noticesearch.php index eb4a072de..4aec41621 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -122,8 +122,8 @@ class NoticesearchAction extends SearchAction $cnt = $nl->show(); - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'noticesearch', array('q' => $q)); + $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, + $page, 'noticesearch', array('q' => $q)); } function isReadOnly() { -- cgit v1.2.3-54-g00ecf From fadae96a74abd710316d336109bf8eca4d9394ac Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 22 Mar 2009 20:21:32 +0000 Subject: Password recover and change form markup updated. --- actions/recoverpassword.php | 22 ++++++++++++++++++++-- theme/base/css/display.css | 4 +++- 2 files changed, 23 insertions(+), 3 deletions(-) (limited to 'actions') diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php index eeb6b2516..620fe7eb8 100644 --- a/actions/recoverpassword.php +++ b/actions/recoverpassword.php @@ -181,13 +181,21 @@ class RecoverpasswordAction extends Action function showRecoverForm() { $this->elementStart('form', array('method' => 'post', - 'id' => 'recoverpassword', + 'id' => 'form_password_recover', + 'class' => 'form_settings', 'action' => common_local_url('recoverpassword'))); + $this->elementStart('fieldset'); + $this->element('legend', null, _('Password recover')); + $this->elementStart('ul', 'form_data'); + $this->elementStart('li'); $this->input('nicknameoremail', _('Nickname or email'), $this->trimmed('nicknameoremail'), _('Your nickname on this server, ' . 'or your registered email address.')); + $this->elementEnd('li'); + $this->elementEnd('ul'); $this->submit('recover', _('Recover')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); } @@ -213,14 +221,24 @@ class RecoverpasswordAction extends Action function showResetForm() { $this->elementStart('form', array('method' => 'post', - 'id' => 'recoverpassword', + 'id' => 'form_password_change', + 'class' => 'form_settings', 'action' => common_local_url('recoverpassword'))); + $this->elementStart('fieldset'); + $this->element('legend', null, _('Password change')); $this->hidden('token', common_session_token()); + $this->elementStart('ul', 'form_data'); + $this->elementStart('li'); $this->password('newpassword', _('New password'), _('6 or more characters, and don\'t forget it!')); + $this->elementEnd('li'); + $this->elementStart('li'); $this->password('confirm', _('Confirm'), _('Same as password above')); + $this->elementEnd('li'); + $this->elementEnd('ul'); $this->submit('reset', _('Reset')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); } diff --git a/theme/base/css/display.css b/theme/base/css/display.css index c741ed4cb..a10ec0223 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -150,7 +150,9 @@ font-weight:bold; #form_openid_login legend, #form_search legend, #form_invite legend, -#form_notice_delete legend { +#form_notice_delete legend, +#form_password_recover legend, +#form_password_change legend { display:none; } -- cgit v1.2.3-54-g00ecf