Closed (won't fix)
Project:
Flag
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Jun 2011 at 22:48 UTC
Updated:
12 Dec 2012 at 14:46 UTC
Jump to comment: Most recent
Comments
Comment #1
TimelessDomain commentedthere is a flag counter. Though the flag counter does not have a day limitation. You could do most flagged nodes of nodes created in the last 30 days. What you want though is like statistics. Top Flagged Today, Top Flagged All-Time, or Top Flagged over X # of Days. this would be a cool feature, especially if you are using flag to replace voting modules. This would be a feature request then.
Comment #2
brunorios1 commentedit's exactly what i want!
since it's not possible yet, i created a view that list the top flagged nodes that was flagged in the last 30 days, like a "trending" list...
but the "statistics" feature would be perfect!
thanks.
Comment #3
quicksketchThis generally is not possible in Flag. You may be able to accomplish it with Views 3, which provides the ability to do COUNT() queries within a View, but it's going to be a very expensive query. Instead of using the Flag Count fields, you'd need to use the Flag Content fields and execute a COUNT() on them. In order to make this performant, you'd want to make a dedicated database table for "week", "month", "year", or whatever, on which you could easily sort such information.
I don't think this will be added as a feature to the Flag module directly, it would be an excellent contrib add-on solution though.
Comment #4
Anonymous (not verified) commentedThe core comment module stores three counts: today, week, all-time. Flags could do this.
But a cheaper solution is a View with the flag_count and then restrict by nodes create date > -30 days. Using CCK date. That way only nodes from last month are shown.
Comment #5
brunorios1 commented@morningtime
this isn't a "solution"...
most flagged nodes that was CREATED in the last 30 days
is very different of
most flagged nodes in the last 30 days...
Comment #6
jordanmagnuson commentedI'm also interested in this, and will probably take a whack at creating a contrib module if no one else has yet.
What I'm thinking is that it would it would be called flag_statistics, and that it would create a db table that would look something like this:
Basically it would just aggregate counts on cron run, similar to core statistics module. Any thoughts?
One issue may be the compound primary key... not sure if views handles compound keys very well?
Comment #7
jordanmagnuson commentedJust struck me that it would be much more performant to hook into the flagging process and update the flag_statistics table when a flag is set (then just reset counts during cron, as per core statistics module), rather than counting flags during cron. Counting flags during cron will get very expensive as the number of flags grows towards infinity...
So my question is, is it possible to "hook into" the flagging process, in order to update an arbitrary db table when a user flags some content?
Comment #8
joachim commentedMarking as wontfix.
A flag_statistics module would be best off as a separate contrib project.
Comment #9
fadgadget commentedHi did anythign ever come of this? I was hoping to have a 'most flagged user' view and then display it by week, month, alltime etc
thanks
Comment #10
jordanmagnuson commentedI'm still planning to work on this, but it has been bumped down the "to do"...