I'm using the User Badges and User Points modules. I want that when a user earns a certain number of user points, the user's old badge is replaced by a new one. For this, I have already created a rule with the actions "remove badge" and "add badge". The condition is "execute PHP code" and the code is:
$current_points = userpoints_get_current_points($userpoints_transaction->uid, 'all');if ($current_points >=7) { return true;}
I also want to display the badge with the username at the top like StackExchange.
Note: Using the above code, it is displaying a message each time when user getting more than 7 user points. I want the message only once.