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

17 calls to user_get_attribute()
calendar.module in modules/calendar/calendar.module
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.module in modules/engagements/engagements.module
This is the primary module file for the engagements module.
engagements_form_alter in modules/engagements/engagements.module
Implements hook_form_alter
engagements_mass_sms_perform_batch_operation in modules/engagements/engagements.module

... See full list

File

modules/user/user.module, line 1265

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;
}