开发者

How to display user avatar in Drupal 7?

I'd like to know how to display a user avatar in Drupal 7. I want开发者_运维技巧 to display the avatar in full size and as the thumbnail.


You can use something like:

$user_item = user_load_by_name($username); // or user_load( $user->uid )
print theme('user_picture', array('account' =>$user_item));


When I use the user picture is linked to the user profile. I have set my user images to be displayed as thumbnails. I'd like to link the user picture to the full sized picture and display them using lightboxII. It seems to be a very easy task but I couldn't figure out yet how to do it.


Make sure you enable User profiles in the account settings (admin/config/people/accounts) and then you can display them in templates using $user_profile:-

http://api.drupal.org/api/drupal/modules--node--node.tpl.php/7

The user-picture.tpl.php template will let you override how it is output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜