Hi thanks for the module.
I have a user flag type, and im trying to create a view of how many other users each user has flagged.
I created a view, add a flag user relationship, selected the user flag type. then added the flag counter relationship to that flag type relationship. Added two fields, user name and flag counter.
What I though this would do is list all my users, then display how many times theyve flagged a user with the flag in the relationship. But its not, im getting all users that have been flagged with the flag in the relationship. And flag counter stays at 1, no matter how many times each user has been flagged or flagged another user.
Any advice is appreciated
Thanks
Comments
Comment #1
mooffie commentedThese counters count the times each item has been flagged. Figuratively speaking, a counter counts the arrows pointing at an item. Not the arrows pointing out of a flagging user.
You want to count the arrows pointing out of a flagging user.
It's possible. To calculate these numbers you need to use something called "SQL aggregate functions".
We have a handbook page explaining how to create this type of view:
How to setup a block showing the "top ten" users who flagged the most items
- That page assumes it's nodes that are being flagged. But you can adjust that recipe to work with flagged users or comments easily enough.
- "top ten" just means that it's sorted by the counts and slashed to 10. In your case you can omit this part.
To see this view in action visit:
http://www.mjjcollections.com/collections/
(It's the "top ten collectors" block, Views 2.x.)
It seems your flag is a 'global' flag. You'll have to change it to non-global to keep a record of each user's individual flaggings. The recipe I linked to doesn't make sense for global flags.
Comment #2
SamSound commentedThank you