diff options
author | Brion Vibber <brion@status.net> | 2010-01-04 12:02:45 -0800 |
---|---|---|
committer | Brion Vibber <brion@status.net> | 2010-01-04 12:02:45 -0800 |
commit | f5b8177bc752c29228ee76bc95285cdbb8549748 (patch) | |
tree | d316906dbfe91f2065d4a8e254b1e31274a91e8e /actions/favorited.php | |
parent | c0e4d7bfa2181090f05d3b42ed9f9b135b43aea1 (diff) | |
parent | 6911e1c7972c3adec53d0fe04ebdd7da0fbd8b12 (diff) |
Merge branch '2141' into 0.9.x
Diffstat (limited to 'actions/favorited.php')
-rw-r--r-- | actions/favorited.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/actions/favorited.php b/actions/favorited.php index 150b67b0b..9ffa5b844 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -185,11 +185,7 @@ class FavoritedAction extends Action function showContent() { - if (common_config('db', 'type') == 'pgsql') { - $weightexpr='sum(exp(-extract(epoch from (now() - fave.modified)) / %s))'; - } else { - $weightexpr='sum(exp(-(now() - fave.modified) / %s))'; - } + $weightexpr = common_sql_weight('fave.modified', common_config('popular', 'dropoff')); $qry = 'SELECT notice.*, '. $weightexpr . ' as weight ' . @@ -207,7 +203,7 @@ class FavoritedAction extends Action } $notice = Memcached_DataObject::cachedQuery('Notice', - sprintf($qry, common_config('popular', 'dropoff')), + $qry, 600); $nl = new NoticeList($notice, $this); |