- var $page = null;
- var $notice;
-
- /**
- * Prepare the object
- *
- * Check the input values and initialize the object.
- * Shows an error page on bad input.
- *
- * @param array $args $_REQUEST data
- *
- * @return boolean success flag
- */
-
- function prepare($args)
- {
- parent::prepare($args);
-
- $nickname = common_canonical_nickname($this->arg('nickname'));
-
- $this->user = User::staticGet('nickname', $nickname);
-
- if (!$this->user) {
- $this->clientError(_('No such user.'));
- return false;
- }
-
- $profile = $this->user->getProfile();
-
- if (!$profile) {
- $this->serverError(_('User has no profile.'));
- return false;
- }
-
- $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
-
- common_set_returnto($this->selfUrl());
-
- $this->notice = $this->user->getReplies(($this->page-1) * NOTICES_PER_PAGE,
- NOTICES_PER_PAGE + 1);
-
- if($this->page > 1 && $this->notice->N == 0){
- // TRANS: Server error when page not found (404)
- $this->serverError(_('No such page'),$code=404);
- }
-
- return true;
- }
-
- /**
- * Handle a request
- *
- * Just show the page. All args already handled.
- *
- * @param array $args $_REQUEST data
- *
- * @return void
- */
-
- function handle($args)