diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-04-07 23:57:45 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-04-07 23:57:45 -0400 |
commit | 579332aa247140d4da720b6c756c97bffdbf955d (patch) | |
tree | d63dba4ba12d1e98c1004f6971090d20713c80e4 /actions/public.php | |
parent | c21335384e1ee4d078fd1c80db6c2377c133a556 (diff) |
don't use count() to check for empty page
Diffstat (limited to 'actions/public.php')
-rw-r--r-- | actions/public.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/actions/public.php b/actions/public.php index b7b7fc6b7..5a380de9a 100644 --- a/actions/public.php +++ b/actions/public.php @@ -166,19 +166,8 @@ class PublicAction extends Action $nav->show(); } - function showPageNotice() + function showEmptyList() { - $notice = new Notice; - - if (!$notice) { - $this->serverError(_('Could not retrieve public stream.')); - return; - } - - if ($notice->count()) { - return; - } - $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' '; if (common_logged_in()) { @@ -216,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'); } |