You are here

function theme_user_picture in Drupal 4

Same name and namespace in other branches
  1. 5 modules/user/user.module \theme_user_picture()
6 theme calls to theme_user_picture()
phptemplate_comment in themes/engines/phptemplate/phptemplate.engine
Prepare the values passed to the theme_comment function to be passed into a pluggable template engine.
phptemplate_node in themes/engines/phptemplate/phptemplate.engine
theme_profile_block in modules/profile.module
theme_profile_listing in modules/profile.module
theme_user_profile in modules/user.module
Theme a user page

... See full list

File

modules/user.module, line 642
Enables the user registration and login system.

Code

function theme_user_picture($account) {
  if (variable_get('user_pictures', 0)) {
    if ($account->picture && file_exists($account->picture)) {
      $picture = file_create_url($account->picture);
    }
    else {
      if (variable_get('user_picture_default', '')) {
        $picture = variable_get('user_picture_default', '');
      }
    }
    if (isset($picture)) {
      $alt = t('%user\'s picture', array(
        '%user' => $account->name ? $account->name : variable_get('anonymous', 'Anonymous'),
      ));
      $picture = theme('image', $picture, $alt, $alt, '', false);
      if (!empty($account->uid) && user_access('access user profiles')) {
        $picture = l($picture, "user/{$account->uid}", array(
          'title' => t('View user profile.'),
        ), NULL, NULL, FALSE, TRUE);
      }
      return "<div class=\"picture\">{$picture}</div>";
    }
  }
}