]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/tagcloudsection.php
Merge branch 'fixes/private_scope_on_tags' into social-master
[quix0rs-gnu-social.git] / lib / tagcloudsection.php
index 20533dbe2d8dbb51ae3d8051b32c92c7be0b5a1b..ca72a27e521b38f161eedfffbca8759e23f34317 100644 (file)
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-define('TAGS_PER_SECTION', 20);
+define('TAGS_PER_SECTION', 10);
 
 /**
  * Base class for sections
@@ -45,15 +45,15 @@ define('TAGS_PER_SECTION', 20);
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  * @link     http://status.net/
  */
-
 class TagCloudSection extends Section
 {
     function showContent()
     {
         $tags = $this->getTags();
 
-        if (!$tags) {
-            $this->out->element('p', null, _('None'));
+        if (!$tags instanceof Notice_tag) {
+            // TRANS: Content displayed in a tag cloud section if there are no tags.
+            $this->out->element('p', null, _m('NOTAGS','None'));
             return false;
         }
 
@@ -63,12 +63,15 @@ class TagCloudSection extends Section
         $sum = 0;
 
         while ($tags->fetch() && ++$cnt <= TAGS_PER_SECTION) {
-            $tw[$tags->tag] = $tags->weight;
-            $sum += $tags->weight;
+            if ($tags->isCurrentProfileInScope()) {
+                $tw[$tags->tag] = $tags->weight;
+                $sum += $tags->weight;
+            }
         }
 
         if ($cnt == 0) {
-            $this->out->element('p', null, _('(None)'));
+            // TRANS: Content displayed in a tag cloud section if there are no tags.
+            $this->out->element('p', null, _m('NOTAGS','None'));
             return false;
         }