-
- $rsd = common_local_url('rsd');
-
- // RSD, http://tales.phrasewise.com/rfc/rsd
-
- $this->element('link', array('rel' => 'EditURI',
- 'type' => 'application/rsd+xml',
- 'href' => $rsd));
-
- if ($this->page != 1) {
- $this->element('link', array('rel' => 'canonical',
- 'href' => common_local_url('public')));
- }
- }
-
- /**
- * Output <head> elements for RSS and Atom feeds
- *
- * @return void
- */
- function getFeeds()
- {
- return array(new Feed(Feed::JSON,
- common_local_url('ApiTimelinePublic',
- array('format' => 'as')),
- // TRANS: Link description for public timeline feed.
- _('Public Timeline Feed (Activity Streams JSON)')),
- new Feed(Feed::RSS1, common_local_url('publicrss'),
- // TRANS: Link description for public timeline feed.
- _('Public Timeline Feed (RSS 1.0)')),
- new Feed(Feed::RSS2,
- common_local_url('ApiTimelinePublic',
- array('format' => 'rss')),
- // TRANS: Link description for public timeline feed.
- _('Public Timeline Feed (RSS 2.0)')),
- new Feed(Feed::ATOM,
- common_local_url('ApiTimelinePublic',
- array('format' => 'atom')),
- // TRANS: Link description for public timeline feed.
- _('Public Timeline Feed (Atom)')));
- }
-
- function showEmptyList()
- {
- // TRANS: Text displayed for public feed when there are no public notices.
- $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' ';
-
- if (common_logged_in()) {
- // TRANS: Additional text displayed for public feed when there are no public notices for a logged in user.
- $message .= _('Be the first to post!');
- }
- else {
- if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
- // TRANS: Additional text displayed for public feed when there are no public notices for a not logged in user.
- $message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
- }
- }
-
- $this->elementStart('div', 'guide');
- $this->raw(common_markup_to_html($message));
- $this->elementEnd('div');
- }
-
- /**
- * Fill the content area
- *
- * Shows a list of the notices in the public stream, with some pagination
- * controls.
- *
- * @return void
- */
- function showContent()
- {
- $user = common_current_user();
-
- if (!empty($user) && $user->streamModeOnly()) {
- $nl = new NoticeList($this->notice, $this);
- } else {
- $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile);
- }
-
- $cnt = $nl->show();
-
- if ($cnt == 0) {
- $this->showEmptyList();
- }
-
- $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
- $this->page, 'public');