function template_preprocess_user_profile

7.x user.pages.inc template_preprocess_user_profile(&$variables)
6.x user.pages.inc template_preprocess_user_profile(&$variables)

Process variables for user-profile.tpl.php.

The $variables array contains the following arguments:

  • $account

See also

user-picture.tpl.php

File

drupal-6.x/modules/user/user.pages.inc, line 183
User page callback file for the user module.

Code

function template_preprocess_user_profile(&$variables) {
  $variables['profile'] = array();
  // Sort sections by weight
  uasort($variables['account']->content, 'element_sort');
  // Provide keyed variables so themers can print each section independantly.
  foreach (element_children($variables['account']->content) as $key) {
    $variables['profile'][$key] = drupal_render($variables['account']->content[$key]);
  }
  // Collect all profiles to make it easier to print all items at once.
  $variables['user_profile'] = implode($variables['profile']);
}