profile_load_profile

5 profile.module profile_load_profile(&$user)
6 profile.module profile_load_profile(&$user)

2 calls to profile_load_profile()

File

modules/profile/profile.module, line 227
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;
    }
  }
}

Comments

Load Profile into any object ...

You can load the profile variables into ANY object that has a uid property.

For instance, in forum-topic-list.tpl.php, you can load the profile variables for the topic creator into the $topic variable.

profile_load_profile($topic);

so useful!

wow that is really useful if you need to display submissions from the webform module as well, throw this in the webform-submission.tpl.php file:

profile_load_profile($submission);

Login or register to post comments