summaryrefslogtreecommitdiff
path: root/lib/personaltagcloudsection.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-04 10:55:21 -1000
committerEvan Prodromou <evan@status.net>2010-01-04 10:55:21 -1000
commit6add2693b009a2122883f4f6c96c775be878e42c (patch)
treeea6f11e37e44f61216cf9d3f678d2d99a72fc30c /lib/personaltagcloudsection.php
parent96480aa6c1abda95db272f7c0a2b0e96f17acc70 (diff)
parentf5b8177bc752c29228ee76bc95285cdbb8549748 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/personaltagcloudsection.php')
-rw-r--r--lib/personaltagcloudsection.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/personaltagcloudsection.php b/lib/personaltagcloudsection.php
index 0b29d58ca..091425f92 100644
--- a/lib/personaltagcloudsection.php
+++ b/lib/personaltagcloudsection.php
@@ -58,13 +58,9 @@ class PersonalTagCloudSection extends TagCloudSection
function getTags()
{
- if (common_config('db', 'type') == 'pgsql') {
- $weightexpr='sum(exp(-extract(epoch from (now() - notice_tag.created)) / %s))';
- } else {
- $weightexpr='sum(exp(-(now() - notice_tag.created) / %s))';
- }
-
- $qry = 'SELECT notice_tag.tag, '.
+ $weightexpr = common_sql_weight('notice_tag.created', common_config('tag', 'dropoff'));
+
+ $qry = 'SELECT notice_tag.tag, '.
$weightexpr . ' as weight ' .
'FROM notice_tag JOIN notice ' .
'ON notice_tag.notice_id = notice.id ' .
@@ -83,7 +79,6 @@ class PersonalTagCloudSection extends TagCloudSection
$tag = Memcached_DataObject::cachedQuery('Notice_tag',
sprintf($qry,
- common_config('tag', 'dropoff'),
$this->user->id),
3600);
return $tag;