Closed (duplicate)
Project:
Flag
Version:
6.x-2.0-beta3
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2010 at 18:02 UTC
Updated:
27 Oct 2010 at 08:41 UTC
In views, it would be great to be able to filter by date flagged. I would love to be able to retrieve content with views that have been flagged between one date and another.
I would like to be able to allow users to flag content multiple times and be able to restrict flagging to one per day, week, month or year.
If content has been recently flagged, it can show up on a certain page.
Comments
Comment #1
mooffie commentedI believe you can already do that. There's the "Flags: Flagged time" filter. For the Flag relationship you'll have to pick "by any user". And turn on the "Distinct" view setting or else you'll see duplicate rows.
But I now see it'd be problematic to sort this list. I've seen a proposal to add a "last flagged date" (and/or "first flagged date") column to {flag_count}, which could solve it.
There are two ways to do this. The problem is that there won't be nice UI feedback when you hit the limit:
- You can implement hook_flag_access() to forbid flagging under some condition.
- There's a Rules action to "trim" a flag. Currently the cutoff is a certain amount of flaggings but one could contribute a patch to make it work by date too.
Again, the problem is lack of nice UI feedback (when ajax links are used).
Comment #2
mooffie commentedAh, Views 3.x can solve this problem: it supports aggregate functions (I already wrote one recipe for Flag using it). So you can sort by the "Maximum" flagging date.
(Or you can just sort by the node's date if you don't mind.)
Comment #3
mooffie commentedI guess this is fixed.
I'm also marking this a duplicate of:
#652558: Add last_updated timestamp when updating count in flag_counts_table
#952114: Have hook_flag_validate()