function _userpoints_user_exists in User Points 7
Same name and namespace in other branches
- 5.3 userpoints.module \_userpoints_user_exists()
- 5 userpoints.module \_userpoints_user_exists()
- 5.2 userpoints.module \_userpoints_user_exists()
- 6 userpoints.module \_userpoints_user_exists()
File
- ./
userpoints.module, line 1202
Code
function _userpoints_user_exists($uid, $tid = NULL) {
if (is_numeric($tid)) {
return (int) db_query('SELECT COUNT(uid)
FROM {userpoints}
WHERE uid = :uid AND tid = :tid', array(
':uid' => $uid,
':tid' => $tid,
))
->fetchField();
}
else {
return (int) db_query('SELECT COUNT(uid)
FROM {userpoints}
WHERE uid = :uid', array(
':uid' => $uid,
))
->fetchField();
}
}