Closed (duplicate)
Project:
User Badges
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2008 at 17:25 UTC
Updated:
17 Oct 2008 at 20:47 UTC
Hi,
I know there is already a thread for the 5.x but this was specifically for the 6.x version (see the upgrade to 6 thread which has a patch I created) - I created a module to put the 2 together - please take a look at the code and let me know what you think.
| Comment | File | Size | Author |
|---|---|---|---|
| userpoints_badges.zip | 7.44 KB | btmash |
Comments
Comment #1
Fayna commentedAwesome BTMash! I'm glad you're around, hehe :)
Comment #2
heine commentedI'm reluctant to have this special case for userpoints.
When userpoints assigns a role, it should call implementations of hook_user with the correct arguments. Then, userbadges will be properly assigned.
Comment #3
btmash commentedHi Heine,
I know userpoints has a module called userpoints_roles which can put a user into and out of roles on a site (and I know you can assign roles to have various badges associated with them). I'd like to clarify that this is different from that module (its simply userpoints and user_badges with nothing else involved).
In the case of this module, it doesn't jump a user to different roles (ie, a user is not placed into different roles on the site) - its basically a way to show a user reached a certain number of points on a site (it checks via the userpoints api and assigns the user a new badge once they're reached X points and stays at that). So let's say you wanted to have 12 badges for 12 milestones in the content a user submits (but their abilities on the site don't change), you don't have to create 12 other roles to go with it. Since there was already a user_badges_user table that associates a badge with a user (and you had implemented a user_badges_add_user_badge() function), I call that function to add a new badge.
Comment #4
michelleI haven't looked at the code but the description sounds very useful. I, too, would like to assign badges based on points, not roles. I haven't gotten to that point on my site, yet, so didn't realize it wasn't already possible until I stumbled across this thread.
Michelle
Comment #5
daphisto commentedYeah, I am totally down with this idea... now only if it was for 5.x... :)
Comment #6
kbahey commentedBTMash
Do you want to commit this to the userpoints contrib project? I can give you CVS access if you want, or I can commit it on your behalf.
Let me know ...
Comment #7
btmash commentedMoving this out to #320147: Userpoints integration with badges module so it will be part of the userpoints contrib project.