]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
hide group name and aliases in group tag cloud section
authorEvan Prodromou <evan@controlyourself.ca>
Wed, 17 Jun 2009 22:20:44 +0000 (15:20 -0700)
committerEvan Prodromou <evan@controlyourself.ca>
Wed, 17 Jun 2009 22:20:44 +0000 (15:20 -0700)
lib/grouptagcloudsection.php

index 5d68af28bf7bdc62e8a9ba3b3892a3b03c6d8084..9b7a10f6b9ea029e45bda11f64fa7604411f04b3 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('LACONICA')) {
 }
 
 /**
- * Personal tag cloud section
+ * Group tag cloud section
  *
  * @category Widget
  * @package  Laconica
@@ -64,12 +64,27 @@ class GroupTagCloudSection extends TagCloudSection
             $weightexpr='sum(exp(-(now() - notice_tag.created) / %s))';
         }
 
+        $names = $this->group->getAliases();
+
+        $names = array_merge(array($this->group->nickname), $names);
+
+        // XXX This is dumb.
+
+        $quoted = array();
+
+        foreach ($names as $name) {
+            $quoted[] = "\"$name\"";
+        }
+
+        $namestring = implode(',', $quoted);
+
         $qry = 'SELECT notice_tag.tag, '.
           $weightexpr . ' as weight ' .
           'FROM notice_tag JOIN notice ' .
           'ON notice_tag.notice_id = notice.id ' .
           'JOIN group_inbox on group_inbox.notice_id = notice.id ' .
           'WHERE group_inbox.group_id = %d ' .
+          'AND notice_tag.tag not in (%s) '.
           'GROUP BY notice_tag.tag ' .
           'ORDER BY weight DESC ';
 
@@ -85,9 +100,9 @@ class GroupTagCloudSection extends TagCloudSection
         $tag = Memcached_DataObject::cachedQuery('Notice_tag',
                                                  sprintf($qry,
                                                          common_config('tag', 'dropoff'),
-                                                         $this->group->id),
+                                                         $this->group->id,
+                                                         $namestring),
                                                  3600);
         return $tag;
     }
-
 }