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/favorited.php | |
parent | c21335384e1ee4d078fd1c80db6c2377c133a556 (diff) |
don't use count() to check for empty page
Diffstat (limited to 'actions/favorited.php')
-rw-r--r-- | actions/favorited.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/actions/favorited.php b/actions/favorited.php index 27da25435..09ab1216a 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -104,9 +104,9 @@ class FavoritedAction extends Action { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - + common_set_returnto($this->selfUrl()); - + return true; } @@ -143,13 +143,10 @@ class FavoritedAction extends Action $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); + } - $favorite = new Fave; - - if ($favorite->count()) { - return; - } - + function showEmptyList() + { $message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' '; if (common_logged_in()) { @@ -217,6 +214,10 @@ class FavoritedAction extends Action $cnt = $nl->show(); + if ($cnt == 0) { + $this->showEmptyList(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited'); } |