summaryrefslogtreecommitdiff
path: root/lib/grouptagcloudsection.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-17 15:20:44 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-17 15:20:44 -0700
commit2187ec7056a23e76c756f354bf41e3835ba8d103 (patch)
tree26e090e75d9342a90ea7716beb4792c3d52c87f6 /lib/grouptagcloudsection.php
parent420e8994f8f62c22073e70e081daadfa2d8d7c06 (diff)
hide group name and aliases in group tag cloud section
Diffstat (limited to 'lib/grouptagcloudsection.php')
-rw-r--r--lib/grouptagcloudsection.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/grouptagcloudsection.php b/lib/grouptagcloudsection.php
index 5d68af28b..9b7a10f6b 100644
--- a/lib/grouptagcloudsection.php
+++ b/lib/grouptagcloudsection.php
@@ -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;
}
-
}