function user_get_attribute

7.x user.module user_get_attribute($user_id, $name, $default_value = "")
6.x user.module user_get_attribute($user_id, $name, $default_value = "")

Very similar to variable_get

12 calls to user_get_attribute()
calendar_get_appointments_for_faculty in modules/calendar/calendar.module
Return back a list of appointment content nodes for this faculty member, which fall between the specified datetimes.
engagements_form_alter in modules/engagements/engagements.module
Implements hook_form_alter
engagements_mass_sms_perform_batch_operation in modules/engagements/engagements.module
engagements_send_email_or_txt_form_submit in modules/engagements/engagements.module
engagements_send_email_or_txt_form_validate in modules/engagements/engagements.module

... See full list

File

modules/user/user.module, line 1255

Code

function user_get_attribute($user_id, $name, $default_value = "") {
  $val = db_result(db_query("SELECT value FROM user_attributes WHERE user_id = ? AND name = ?", array($user_id, $name)));

  if (!$val) {
    $val = $default_value;
  }


  return $val;
}