+ $this->userProfile = Profile::current();
+
+ $stream = new ThreadingPublicNoticeStream($this->userProfile);
+
+ $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE,
+ NOTICES_PER_PAGE + 1);
+
+ if (!$this->notice) {
+ // TRANS: Server error displayed when a public timeline cannot be retrieved.
+ $this->serverError(_('Could not retrieve public stream.'));
+ return;
+ }
+
+ if($this->page > 1 && $this->notice->N == 0){
+ // TRANS: Server error when page not found (404).
+ $this->serverError(_('No such page.'),$code=404);
+ }
+