Assigning a badge to a user using Flag, Badges and Rules I am interested in assigning to user a Badge after he favourites 3 nodes. I want to do this with Flag, User badges and Rules.

How can I do that?
I would use the Goals module for this.


Create a 'Favorite node' task and a 'Favorited 3 nodes' goals.
Add an image to the goal. This is going to be your badge.
Create an 'Add to favourites' flag.
Create a rule that "records a task for goals" when a node is "flagged under 'Add to favourites'".
If you don't really need the User badges module, you can create an image field called 'Badge' for the users and use the following custom module (you can find more information here):

function MYMODULE_goals_completed_goal($goal_id, $uid) {
   $user = user_load($uid);
   $goal = goals_load($goal_id);
   $fid = $goal-&gt;goal_img['und'][0]['fid'];
   $img_title = $goal-&gt;goal_img['und'][0]['filename'];

   $edit = array();
   $edit['field_badge']['und']['0']['fid'] = $fid;

   user_save($user, $edit);
}

If you really need the User badges module, I think you can adapt the code a bit and everything should work fine.