summaryrefslogtreecommitdiff
path: root/lib/personaltagcloudsection.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2010-01-09 21:43:25 +0000
committerBrenda Wallace <shiny@cpan.org>2010-01-09 21:43:25 +0000
commit4de09d6bd4eab3259d42fa846e4dd31f2516a038 (patch)
treedf650402df1abcb64e1aa9640eeeb782b3c20f03 /lib/personaltagcloudsection.php
parentf4459dfedcdea2f2a6078bedf9530deb45b6d52c (diff)
parentf396701b6466749c09ce16b1e7f2f96c10b05cdd (diff)
Merge commit 'origin/0.9.x' 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;