You are here

function user_badges_user_remove_badge in User Badges 5

Same name and namespace in other branches
  1. 6.2 user_badges.module \user_badges_user_remove_badge()
  2. 6 user_badges.module \user_badges_user_remove_badge()
  3. 7.4 user_badges.module \user_badges_user_remove_badge()
  4. 7 user_badges.module \user_badges_user_remove_badge()
  5. 7.2 user_badges.module \user_badges_user_remove_badge()
  6. 7.3 user_badges.module \user_badges_user_remove_badge()

remove a badge from user.

Parameters

$uid User ID.:

$bid Badge ID.:

$type Whether set as part of the role, or individually assigned ('user', 'role').:

Return value

bool with query success

2 calls to user_badges_user_remove_badge()
user_badges_user in ./user_badges.module
Implementation of hook_user() This handles assignment of badges based on role. When role is assigned or removed, appropriate badges are added or removed.
user_badges_user_save in ./user_badges.module
Assign user badges to a user

File

./user_badges.module, line 345
@brief User Badges module file

Code

function user_badges_user_remove_badge($uid, $bid, $type = NULL) {
  if (is_null($type)) {
    return db_query('DELETE FROM {user_badges_user} WHERE uid=%d AND bid=%d', $uid, $bid);
  }
  else {
    return db_query('DELETE FROM {user_badges_user} WHERE uid=%d AND bid=%d AND type=\'%s\'', $uid, $bid, $type);
  }
}