diff options
author | Zach Copley <zach@controlyourself.ca> | 2009-03-04 16:21:37 -0800 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2009-03-04 16:21:37 -0800 |
commit | 77e4fad9fac63151c3eee0c3c785c8cf2fa356fb (patch) | |
tree | 9803f20b702a6233d67bd201166268f9780e5e4e /lib/grouptagcloudsection.php | |
parent | 36bb33fb1d7b4befe2fb68c2eef0712619359293 (diff) | |
parent | e239a5529abc0958c4f874811ff704f1e5d6ba62 (diff) |
Merge branch '0.7.x' of git@gitorious.org:laconica/dev into 0.7.x
Diffstat (limited to 'lib/grouptagcloudsection.php')
-rw-r--r-- | lib/grouptagcloudsection.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/grouptagcloudsection.php b/lib/grouptagcloudsection.php index f05be85cb..5d68af28b 100644 --- a/lib/grouptagcloudsection.php +++ b/lib/grouptagcloudsection.php @@ -58,8 +58,14 @@ class GroupTagCloudSection 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, '. - 'sum(exp(-(now() - notice_tag.created)/%s)) as weight ' . + $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 ' . |