Because my site requires user pictures to be approved, the default Drupal user picture is not suitable.
Instead, I want to show a picture from a field in each user's profile as the user's profile picture.
The field is "field_profile_picture".
The image style is "profile_picture".
Based on this tutorial, I put the following code in user-picture.tpl.php in my theme's templates folder:
if (!empty($user->field_profile_picture['und'][0]['filename'])) {
echo theme('image_style', array('style_name' => 'profile_pic', 'path' => file_build_uri($user->field_profile_picture['und'][0]['filename'])));
}
This doesn't result in any PHP errors but no picture is displayed. It appears that field_acc_profile_picture is evaluating as empty because even if I put a print "Hello world";
inside the {} it doesn't appear. However, I am sure that the field has a value because I can see the picture displayed in views.