X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublic.php;h=8c724466368624ab98932f9e6179852b70fd4876;hb=710febfba16d19e0ca46a88ffcb16eb6b5521be2;hp=847aba666e6c41d2e97856d90ad3e50e3de68e06;hpb=66c97a1a1ee782b364ab68eed27193f3caf34965;p=quix0rs-gnu-social.git diff --git a/actions/public.php b/actions/public.php index 847aba666e..8c72446636 100644 --- a/actions/public.php +++ b/actions/public.php @@ -60,7 +60,6 @@ class PublicAction extends Action var $page = null; var $notice; var $userProfile = null; - var $mode = 'conversation'; function isReadOnly($args) { @@ -89,9 +88,9 @@ class PublicAction extends Action $this->userProfile = Profile::current(); - $this->mode = $this->trimmed('mode', 'conversation'); + $user = common_current_user(); - if ($this->mode == 'stream') { + if (!empty($user) && $user->streamModeOnly()) { $stream = new PublicNoticeStream($this->userProfile); } else { $stream = new ThreadingPublicNoticeStream($this->userProfile); @@ -160,6 +159,11 @@ class PublicAction extends Action $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'))); + } } /** @@ -220,7 +224,9 @@ class PublicAction extends Action */ function showContent() { - if ($this->mode == 'stream') { + $user = common_current_user(); + + if (!empty($user) && $user->streamModeOnly()) { $nl = new NoticeList($this->notice, $this); } else { $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile); @@ -254,7 +260,9 @@ class PublicAction extends Action $ibs->show(); } - $pop = new PopularNoticeSection($this); + $p = Profile::current(); + + $pop = new PopularNoticeSection($this, $p); $pop->show(); if (!common_config('performance', 'high')) { $cloud = new PublicTagCloudSection($this);