Closed (fixed)
Project:
Profile 2
Version:
7.x-1.3
Component:
Miscellaneous
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2013 at 15:40 UTC
Updated:
19 Aug 2013 at 13:58 UTC
Is there a way to display the user picture (set by the user in the Account Settings) in profile2.tpl.php?
I have ~300 users with user pictures already set in their account settings.
I want to use Profile2, and to display the picture set in someone's account settings on their profile2 page.
Adding this to profile2.tpl.php has not worked:
<?php global $user;
$user = user_load($user->uid);
print theme_image_style(
array(
'style_name' => 'thumbnail',
'path' =>$user->picture->uri,
'attributes' => array(
'class' => 'avatar'
),
'width' => NULL,
'height' => NULL,
)
);
?>
Comments
Comment #1
radiocontrolled commentedHi, I just wanted to share the solution here that I found, in case it could help anyone. What I had to do was figure out the uid of the user whose profile is displaying:
Comment #2
radiocontrolled commentedComment #2.0
radiocontrolled commentedcorrected indentation.