4

In my website I have the Vote Up/Down module and the User Points module enabled and a rule (using Rules) to add user points for every vote automatically.

What is the way to add Custom Badges depending on User Points?

Let's say, if a user has 100-150 user points then the user's badge will be "Newbie". If the user has 150-200 points then the badge will be "Regular" and continues...

I have tried with the Achievements module but it seems difficult!

So what is the way to add custom badges depending on User Points?

1

Why not simply use the user_badges module which explicitly integrates with userpoints?

userpoints_badges
Integrates Userpoints with the User Badges module.

Check out the userpoints contrib modules list, there may be more tools in there you can use..

  • i am using drupal 7 but drupal.org/project/user_badges not yet has any Recommended releases for drupal 7 and same for userpoints contrib modules :( – rakibtg Feb 15 '13 at 16:13
  • fair point but these two modules (user badges and achievements) are the best implementations of this design pattern to date in Drupal (though you could try this recipe for using Rules + Views drupal.org/node/1105300). If they don't meet your requirements, your choices are to develop your own custom solution or chip-in on helping get the existing modules production-ready. – schnippy Feb 15 '13 at 17:07
0

If you don't have the required skills to use the Achievements module, or just don't want to do such coding (or don't want to hire somebody with such skills), then you may want to look at the Goals module (disclosure: I'm the maintainer of it) as a possible alternative. To start using it only requires typical administration tasks (configuration), though it does come with various hooks also for custom module development (if you want to).

To "add Custom Badges depending on User Points" (as in your question), this is what you could do:

  • Define a goal for each badge you want to use. In your case these goals could fit:

    • Goal 1: "Receive the Newbie badge".
    • Goal 2: "Receive the Regular badge".
  • Define the tasks it takes to complete Goal 1, something like "Gain at least 100 user points" (you could add more tasks if you want, but for your case only 1 would be sufficient). Define similar tasks to complete Goal 2 (something like "Gain at least 150 user points").

  • Use the Rules module to capture the event that a user is granted user points, and add a Rules Action to "Record progress on a task" (add whatever Rules Condition if needed).

With the above configuration in place, Goals will then take care of checking which user completed which goal. And it also provides a Rules Event about "A goal completed by a user". Using that Rules Event, you can then perform whatever Rules Action that fits to grant the badge you want.

However Goals also allows for configuring an image for a goal. And it comes with a Views block which shows "Your completed goals". So you either use that image (if it fits your needs). Or you use the delivered view to create your custom version of it. Or you use some Rules Action to e.g. assign some badge using User Badges, similar to what is shown in my answer to "How to add a new user badge after earning a certain number of user points?".

For more details about the Goals module, including resources, etc, refer to my answer to "How to implement gamification in a Drupal site and award incentives?".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.