Hi everyone,
I've been setting up a Views (3.0) page that will display a list of user-generated node content sorted by a flag counter (via the Flag (2.0) module) in Drupal 7.
This works just fine, but I'm also interested in creating a sort criteria that will take into account the recency of a node's flag. I.e. When the website starts building a significant and consistent amount of traffic of users flagging content, I want a Views page that will help push content that is flagged more recently higher on the sorted list, creating sort of a hype/trending feed.
E.g. I envision a simple algorithm that could be dynamically calculated and continuously updated (in the form of an integer content field, perhaps) in which a flag made by a user in the last:
6 hours is weighted 10X,
12 hours is weighted 9X,
1 day is weighted 8X,
2 days is weighted 7X,
3 days is weighted 6X,
4 days is weighted 5X,
5 days is weighted 4X,
1 week is weighted 3X,
2 weeks is weighted 2X,
1 month is weighted 1.5X,