template_preprocess_profile_listing

Versions
6 – 7
template_preprocess_profile_listing(&$variables)

Process variables for profile-listing.tpl.php.

The $variables array contains the following arguments:

  • $account
  • $fields

See also

profile-listing.tpl.php

Code

modules/profile/profile.module, line 510

<?php
function template_preprocess_profile_listing(&$variables) {

  $variables['picture'] = theme('user_picture', $variables['account']);
  $variables['name'] = theme('username', $variables['account']);
  $variables['profile'] = array();
  // Supply filtered version of $fields that have values.
  foreach ($variables['fields'] as $field) {
    if ($field->value) {
      $variables['profile'][$field->name]->title = $field->title;
      $variables['profile'][$field->name]->value = $field->value;
      $variables['profile'][$field->name]->type = $field->type;
    }
  }

}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.