summaryrefslogtreecommitdiff
path: root/actions/all.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-12 10:50:46 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-08-12 10:50:46 -0700
commit7d33478e867cc6610aded42a8f2fa71bae46804d (patch)
tree73a422fac7006ee40ff51c21922ca22f68cab40d /actions/all.php
parent01dccefcccc8ca4c1fec419f47cf723d0498c3ef (diff)
parent853b6d38b362e3a905195d9ff850c9a884d412bd (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
Diffstat (limited to 'actions/all.php')
-rw-r--r--actions/all.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/actions/all.php b/actions/all.php
index 5db09a0e6..38aee65b6 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -25,11 +25,31 @@ require_once INSTALLDIR.'/lib/feedlist.php';
class AllAction extends ProfileAction
{
+ var $notice;
+
function isReadOnly($args)
{
return true;
}
+ function prepare($args)
+ {
+ parent::prepare($args);
+ $cur = common_current_user();
+
+ if (!empty($cur) && $cur->id == $this->user->id) {
+ $this->notice = $this->user->noticeInbox(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+ } else {
+ $this->notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
+ }
+
+ if($this->page > 1 && $this->notice->N == 0){
+ $this->serverError(_('No such page'),$code=404);
+ }
+
+ return true;
+ }
+
function handle($args)
{
parent::handle($args);
@@ -100,15 +120,7 @@ class AllAction extends ProfileAction
function showContent()
{
- $cur = common_current_user();
-
- if (!empty($cur) && $cur->id == $this->user->id) {
- $notice = $this->user->noticeInbox(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- } else {
- $notice = $this->user->noticesWithFriends(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1);
- }
-
- $nl = new NoticeList($notice, $this);
+ $nl = new NoticeList($this->notice, $this);
$cnt = $nl->show();