function theme_user_picture in Drupal 5
Same name and namespace in other branches
- 4 modules/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 - Prepare the values passed to the theme_node function to be passed into a pluggable template engine.
- theme_profile_block in modules/
profile/ profile.module - theme_profile_listing in modules/
profile/ profile.module - theme_user_profile in modules/
user/ user.module - Theme a user page
File
- modules/
user/ user.module, line 632 - 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', t('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>";
}
}
}