Userpoints integration with badges for 6.x
BTMash - April 4, 2008 - 17:25
| Project: | User Badges |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Jump to:
Description
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.
| Attachment | Size |
|---|---|
| userpoints_badges.zip | 7.44 KB |

#1
Awesome BTMash! I'm glad you're around, hehe :)
#2
I'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.
#3
Hi 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.
#4
I 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
#5
Yeah, I am totally down with this idea... now only if it was for 5.x... :)
#6
BTMash
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 ...
#7
Moving this out to #320147: Userpoints integration with badges module so it will be part of the userpoints contrib project.