Ticket 2141: bugs with weighted popularity lists across year boundary.
authorBrion Vibber <brion@status.net>
Mon, 4 Jan 2010 21:01:17 +0000 (13:01 -0800)
committerBrion Vibber <brion@status.net>
Mon, 4 Jan 2010 21:01:17 +0000 (13:01 -0800)
commitaf95005bc481d6f8f84a780bdc062426e22f3a03
tree3ff7380f81ff918a0b42d4c4a55dfa3a41412053
parentd32fb7c7c40e3d5fa67496d5df0574fc9c2e0151
Ticket 2141: bugs with weighted popularity lists across year boundary.

Consolidated several separate implementations of the same weighting algorithm into common_sql_weight() and fixed some bugs...
For MySQL, now using timestampdiff() instead of subtraction for the comparison, so we get sane results when the year doesn't match, and utc_timestamp() rather than now() so we don't get negative ages for recent items with local server timezone.
Unknown whether the same problems affect PostgreSQL, but note that it lacks the timestampdiff() SQL function.
actions/favorited.php
actions/publictagcloud.php
lib/grouptagcloudsection.php
lib/personaltagcloudsection.php
lib/popularnoticesection.php
lib/util.php