summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/all.php26
-rw-r--r--actions/favorited.php4
-rw-r--r--actions/groupsearch.php24
-rw-r--r--actions/noticesearch.php21
-rw-r--r--actions/peoplesearch.php19
-rw-r--r--actions/public.php4
-rw-r--r--actions/publictagcloud.php4
7 files changed, 67 insertions, 35 deletions
diff --git a/actions/all.php b/actions/all.php
index 8e67ec0f3..9a1632670 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -93,6 +93,32 @@ class AllAction extends Action
$nav->show();
}
+ function showPageNotice()
+ {
+ $notice = $this->user->noticesWithFriends(0, 1);
+ if ($notice->count()) {
+ return;
+ }
+
+ $message = sprintf(_('This is the timeline for %s and friends but no one has posted anything yet.'), $this->user->nickname) . ' ';
+
+ if (common_logged_in()) {
+ $current_user = common_current_user();
+ if ($this->user->id === $current_user->id) {
+ $message .= _('Try subscribing to more people, [join a group](%%action.groups) or post something yourself.');
+ } else {
+ $message .= sprintf(_('You can try to [nudge %s](./) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, '@' . $this->user->nickname);
+ }
+ }
+ else {
+ $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+ }
+
+ $this->elementStart('div', 'guide');
+ $this->raw(common_markup_to_html($message));
+ $this->elementEnd('div');
+ }
+
function showContent()
{
$notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
diff --git a/actions/favorited.php b/actions/favorited.php
index 20a354674..27da25435 100644
--- a/actions/favorited.php
+++ b/actions/favorited.php
@@ -150,7 +150,7 @@ class FavoritedAction extends Action
return;
}
- $message = _('Favorite notices appear on this page but noone has favorited one yet.') . ' ';
+ $message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' ';
if (common_logged_in()) {
$message .= _('Be the first to add a notice to your favorites by clicking the fave button next to any notice you like.');
@@ -159,7 +159,7 @@ class FavoritedAction extends Action
$message .= _('Why not [register an account](%%action.register%%) and be the first to add a notice to your favorites!');
}
- $this->elementStart('div', 'blankfiller');
+ $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
}
diff --git a/actions/groupsearch.php b/actions/groupsearch.php
index 109a53ce1..06b4a7755 100644
--- a/actions/groupsearch.php
+++ b/actions/groupsearch.php
@@ -72,12 +72,23 @@ class GroupsearchAction extends SearchAction
$terms = preg_split('/[\s,]+/', $q);
$results = new GroupSearchResults($user_group, $terms, $this);
$results->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 = _('Why not [register an account](%%action.register%%) and [create the group](%%action.newgroup%%) yourself!');
+ }
+ $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));
}
}
@@ -98,10 +109,5 @@ class GroupSearchResults extends GroupList
{
return preg_replace($this->pattern, '<strong>\\1</strong>', htmlspecialchars($text));
}
-
- function isReadOnly()
- {
- return true;
- }
}
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index 9058cf53c..095d0a454 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -114,22 +114,27 @@ 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($page > 1, $cnt > NOTICES_PER_PAGE,
$page, 'noticesearch', array('q' => $q));
}
-
- function isReadOnly()
- {
- return true;
- }
}
class SearchNoticeList extends NoticeList {
diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php
index 9e515ade1..65d970dd1 100644
--- a/actions/peoplesearch.php
+++ b/actions/peoplesearch.php
@@ -60,14 +60,8 @@ class PeoplesearchAction extends SearchAction
function showResults($q, $page)
{
-
$profile = new Profile();
-
- // 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.
$search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
@@ -81,14 +75,15 @@ class PeoplesearchAction extends SearchAction
$terms = preg_split('/[\s,]+/', $q);
$results = new PeopleSearchResults($profile, $terms, $this);
$results->show();
+ $profile->free();
+ $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE,
+ $page, 'peoplesearch', array('q' => $q));
+
} else {
- $this->element('p', 'error', _('No results'));
+ $this->element('p', 'error', _('No results.'));
+ $this->searchSuggestions($q);
+ $profile->free();
}
-
- $profile->free();
-
- $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE,
- $page, 'peoplesearch', array('q' => $q));
}
}
diff --git a/actions/public.php b/actions/public.php
index 5a2720a9a..b7b7fc6b7 100644
--- a/actions/public.php
+++ b/actions/public.php
@@ -179,7 +179,7 @@ class PublicAction extends Action
return;
}
- $message = _('This is the public timeline for %%site.name%% but noone has posted anything yet.') . ' ';
+ $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
if (common_logged_in()) {
$message .= _('Be the first to post!');
@@ -188,7 +188,7 @@ class PublicAction extends Action
$message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
}
- $this->elementStart('div', 'blankfiller');
+ $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
}
diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php
index 5bc7e0cbf..0cd8940d4 100644
--- a/actions/publictagcloud.php
+++ b/actions/publictagcloud.php
@@ -68,7 +68,7 @@ class PublictagcloudAction extends Action
return;
}
- $message = _('Noone has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' ';
+ $message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' ';
if (common_logged_in()) {
$message .= _('Be the first to post one!');
@@ -77,7 +77,7 @@ class PublictagcloudAction extends Action
$message .= _('Why not [register an account](%%action.register%%) and be the first to post one!');
}
- $this->elementStart('div', 'blankfiller');
+ $this->elementStart('div', 'guide');
$this->raw(common_markup_to_html($message));
$this->elementEnd('div');
}