X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fpublic.php;h=5e07a893ff645239ee4de3c0ccff7ff9d9a8c3df;hb=b81857656f95861cd687abd804bb489635f1b2d9;hp=f62d032ef8ba5ee9c28cd48752d3cd0c2c37f3c2;hpb=8eac5d26387384a07c00fd0ffca1c10d5d7d82f2;p=quix0rs-gnu-social.git diff --git a/actions/public.php b/actions/public.php index f62d032ef8..5e07a893ff 100644 --- a/actions/public.php +++ b/actions/public.php @@ -27,13 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/publicgroupnav.php'; -require_once INSTALLDIR.'/lib/noticelist.php'; -require_once INSTALLDIR.'/lib/feedlist.php'; +if (!defined('GNUSOCIAL')) { exit(1); } // Farther than any human will go @@ -88,7 +82,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); @@ -96,7 +96,6 @@ class PublicAction extends Action if (!$this->notice) { // TRANS: Server error displayed when a public timeline cannot be retrieved. $this->serverError(_('Could not retrieve public timeline.')); - return; } if($this->page > 1 && $this->notice->N == 0){ @@ -153,6 +152,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 +217,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 +239,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,10 +253,12 @@ class PublicAction extends Action $ibs->show(); } - $pop = new PopularNoticeSection($this); - $pop->show(); - $cloud = new PublicTagCloudSection($this); - $cloud->show(); + $p = Profile::current(); + + if (!common_config('performance', 'high')) { + $cloud = new PublicTagCloudSection($this); + $cloud->show(); + } $feat = new FeaturedUsersSection($this); $feat->show(); }