function prepare($args) { Action::prepare($args); // skip the ProfileAction code and replace it... $id = $this->arg('id'); $this->user = false; $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_m('User has no profile.')); return false; } $user = User::staticGet('id', $this->profile->id); if ($user) { // This is a local user -- send to their regular profile. $url = common_local_url('showstream', array('nickname' => $user->nickname)); common_redirect($url); return false; } $this->tag = $this->trimmed('tag'); $this->page = $this->arg('page') ? $this->arg('page') + 0 : 1; common_set_returnto($this->selfUrl()); $p = Profile::current(); if (empty($this->tag)) { $stream = new ProfileNoticeStream($this->profile, $p); } else { $stream = new TaggedProfileNoticeStream($this->profile, $this->tag, $p); } $this->notice = $stream->getNotices(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); return true; }
function prepare($args) { parent::prepare($args); $p = Profile::current(); if (empty($this->tag)) { $stream = new ProfileNoticeStream($this->profile, $p); } else { $stream = new TaggedProfileNoticeStream($this->profile, $this->tag, $p); } $this->notice = $stream->getNotices(($this->page - 1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); return true; }
function getTaggedNotices($tag, $offset = 0, $limit = NOTICES_PER_PAGE, $since_id = 0, $max_id = 0) { $stream = new TaggedProfileNoticeStream($this, $tag); return $stream->getNotices($offset, $limit, $since_id, $max_id); }