You are here

function _userpoints_user_exists in User Points 5.3

Same name and namespace in other branches
  1. 5 userpoints.module \_userpoints_user_exists()
  2. 5.2 userpoints.module \_userpoints_user_exists()
  3. 6 userpoints.module \_userpoints_user_exists()
  4. 7 userpoints.module \_userpoints_user_exists()
2 calls to _userpoints_user_exists()
userpoints_my_userpoints in ./userpoints.module
_userpoints_update_cache in ./userpoints.module

File

./userpoints.module, line 760

Code

function _userpoints_user_exists($uid, $tid = NULL) {
  if (is_numeric($tid)) {
    return (int) db_result(db_query('SELECT COUNT(uid)
      FROM {userpoints}
      WHERE uid = %d AND tid = %d ', $uid, $tid));
  }
  else {
    return (int) db_result(db_query('SELECT COUNT(uid)
      FROM {userpoints}
      WHERE uid = %d', $uid));
  }
}