summaryrefslogtreecommitdiff
path: root/actions/public.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/public.php')
-rw-r--r--actions/public.php31
1 files changed, 28 insertions, 3 deletions
diff --git a/actions/public.php b/actions/public.php
index a20ae4032..5a380de9a 100644
--- a/actions/public.php
+++ b/actions/public.php
@@ -166,6 +166,22 @@ class PublicAction extends Action
$nav->show();
}
+ function showEmptyList()
+ {
+ $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!');
+ }
+ else {
+ $message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
+ }
+
+ $this->elementStart('div', 'guide');
+ $this->raw(common_markup_to_html($message));
+ $this->elementEnd('div');
+ }
+
/**
* Fill the content area
*
@@ -189,6 +205,10 @@ class PublicAction extends Action
$cnt = $nl->show();
+ if ($cnt == 0) {
+ $this->showEmptyList();
+ }
+
$this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
$this->page, 'public');
}
@@ -207,9 +227,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');