I was thinking that maybe flag can act as a more advanced user (content) points. One problem that I think that might rise from such a feature is that an admin will see a certain content was 'flagged' 10 times, but won't be able to any user that actually flagged it.
On the other hand it opens a new set of functionlity, for example:
1) assign a user flags (points).
2) every content a user creates, remove one point.
3) When user reaches 0 - remove Role so user can't create another content.
I'll roll a patch in a few days - unless you think it's a bad idea :)
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | flag_set_count_4.patch | 1.94 KB | amitaibu |
| #2 | flag_set_count_2.patch | 1.98 KB | amitaibu |
Comments
Comment #1
quicksketchYou can easily make a view to see who as flagged a piece of content. See this handbook page: http://drupal.org/node/326308
As for your other request, users being "assigned" flags, I think this would make a great contributed module, but maybe not something that would be added to flag itself. There have already been almost a dozen flag_* modules created, which says a lot about the way people are interested in using Flag for different purposes. It seems to me what you're describing is exactly the User Points module, which is ridiculously extensive in it's support for all kinds of things, such as e-commerce through points and gaining points for everything from posting comments to assigning from administrators.
Comment #2
amitaibu1) About the views - what I meant is that the admin will create a views and assume she will see users that flagged the content - as it's flag content is 10, but actually no user has flagged it so far. Just wanted to point this minor thing.
2) The reason I thought about adding this set_count() function to flag itself, as it should be an API function; Otherwise the contrib module will need to UPDATE/ INSERT flag's own DB. Attached patch adds this function. (If it's ok I can add test to it)
Indeed, the goal if this patch is to not need user points and allow *content* points not only users.
Comment #3
quicksketchAh, now this looks good! I should know better than to point you to handbook pages Amitaibu. ;D
This looks good to me, though I've not seen the "@private" PHPdoc word before, this function isn't really private is it? It seems like the entire patch is based on making this new (public) API function. Other than that it seems good to me.
Comment #4
amitaibuRemoved the private (I copied it by mistake from the original _update_count() )
Comment #5
amitaibuFrom IRC with quicksketch, it was decided that it would best be implemented in user-points or a flag_points module.
Comment #6
crea commentedIsn't it a feature that could be implemented via Rules module ? You have event (flagging), you have conditions (who flagged what) and you have actions (afaik there are Rules actions for Userpoints).
Comment #7
amitaibu@crea,
>afaik there are Rules actions for Userpoints
Indeed - some of them I wrote :) I just wanted see how easily we can create a lite userpoints using flag. It's possible, however it should live in contrib.