Exposing the flaggings table
mooffie - February 9, 2009 - 11:25
| Project: | Flag |
| Version: | 6.x-1.x-dev |
| Component: | Views integration |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | flag 1.2 |
Description
One thing the Views support lacks is "real" exposure of the 'flag_content' table. This table stores flaggings. Currently, because of a "let's hide the frightening word 'flaggings' so users feel comfortable" philosophy, this table doesn't get the treat it deserves. Exposing this table is 90% of implementing the "Ability to flag flaggings" feature, but it also enables most trivial things like filtering by flags

#1
I'm attaching a schema of how this can be done. This is a rip off of once-functional old patch I had laying around.
#2
'field' should point to 'fcid', of course, not to 'content_id'. (That snippet was written long ago, when we didn't yet have a primary key on that table.)
#3
subscribing!
#4
Another reason to expose this table:
If we expose this table, we will be able to do a "summary" on the flaggings done during the past X days/hours/etc.
#5
Another reason to expose this table:
The patch achieves this by exposing three relationships: "The flagged node", "The flagged comment", The flagged user".
#6
Another reason to expose this table:
(The "flagged node" relationship I mentioned in the previous reply solves this as well.)
#7
There are many reasons to exposes this table. The code here complements the "flagging flaggings" feature which in itself solves many feature requests.
#8
Tagging as 'flag 1.2' to try to help draw more attention to it.
Also added #464970: Natively support aliases for base tables.
#9
Marked #433308: Get all nodes from all users I have flagged? (Flag Users) as a duplicate of this issue.
Moving.
#10
I feel this would be a great addition as I am wanting to also view the number of flags a node has in a given timeframe and then cause the top flagged item to be hard posted to a front page. Any thoughts if this idea is on the same wavelength? I'd love to get involved but I am totally newb with PHP.
#11
I would like the table exposed in views so that we can create a view of all the users who have flagged a particular node.
#12
You can do that already. See the handbook page on this exact task: http://drupal.org/node/326308
#13
ok almost have it, the handbook says
"you can easily turn it into a block. Add a "Block" display. Since blocks don't get arguments from the URL, you'll have to add the "Node ID from URL" default argument."
but I don't see this "Node ID from URL" option, where is it?
Nevermind, found it under "Provide default argument"