X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublic.php;h=af2fcff842ed737e2b2c4c07b9be14fac8c8aae7;hb=d48076253b02f8ab1f91e54289a189af7017db9f;hp=75217cb2293965ed4394a4701bad86f590650ce0;hpb=31d056029461c5f61e0667ab6f80c21a505e36cc;p=quix0rs-gnu-social.git diff --git a/actions/public.php b/actions/public.php index 75217cb229..af2fcff842 100644 --- a/actions/public.php +++ b/actions/public.php @@ -88,7 +88,13 @@ class PublicAction extends Action $this->userProfile = Profile::current(); - $stream = new ThreadingPublicNoticeStream($this->userProfile); + $user = common_current_user(); + + if (!empty($user) && $user->streamModeOnly()) { + $stream = new PublicNoticeStream($this->userProfile); + } else { + $stream = new ThreadingPublicNoticeStream($this->userProfile); + } $this->notice = $stream->getNotices(($this->page-1)*NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); @@ -153,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'))); + } } /** @@ -213,7 +224,13 @@ class PublicAction extends Action */ function showContent() { - $nl = new ThreadedNoticeList($this->notice, $this, $this->userProfile); + $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(); @@ -229,7 +246,7 @@ class PublicAction extends Action { // Show invite button, as long as site isn't closed, and // we have a logged in user. - if (!common_config('site', 'closed') && common_logged_in()) { + if (common_config('invite', 'enabled') && !common_config('site', 'closed') && common_logged_in()) { if (!common_config('site', 'private')) { $ibs = new InviteButtonSection( $this, @@ -243,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);