]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/public.php
Merge remote-tracking branch 'upstream/master'
[quix0rs-gnu-social.git] / actions / public.php
index 7bcdd3fae208de3eb1c175cb743b07a9a3aa4057..5e07a893ff645239ee4de3c0ccff7ff9d9a8c3df 100644 (file)
  * @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
 
@@ -102,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){
@@ -159,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')));
+        }
     }
 
     /**
@@ -241,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,
@@ -257,8 +255,6 @@ class PublicAction extends Action
 
         $p = Profile::current();
 
-        $pop = new PopularNoticeSection($this, $p);
-        $pop->show();
         if (!common_config('performance', 'high')) {
             $cloud = new PublicTagCloudSection($this);
             $cloud->show();