You are here

function profile_load_profile in Drupal 5

Same name and namespace in other branches
  1. 4 modules/profile.module \profile_load_profile()
  2. 6 modules/profile/profile.module \profile_load_profile()
2 calls to profile_load_profile()
profile_user in modules/profile/profile.module
Implementation of hook_user().
profile_view_profile in modules/profile/profile.module

File

modules/profile/profile.module, line 526
Support for configurable user profiles.

Code

function profile_load_profile(&$user) {
  $result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE uid = %d', $user->uid);
  while ($field = db_fetch_object($result)) {
    if (empty($user->{$field->name})) {
      $user->{$field->name} = _profile_field_serialize($field->type) ? unserialize($field->value) : $field->value;
    }
  }
}