I want to display programmatically default user picture if the user is not uploaded any. For that I have written code php code but its displaying user uploaded user picture correctly but not the one default when user doesn't upload his/her own. How to do that? help me.
$user = user_load($user->uid);
$account = user_load($user->uid);
print theme(
'image_style',
array( 'account' =>$user,
'style_name' => 'x-small',
// 'path' =>!empty($user->picture->uri)?$user->picture->uri:variable_get('user_picture_default'),
'path' =>!empty($user->picture->uri)?$user->picture->uri:variable_get('user_picture_default',''),
'attributes' => array(
'class' => 'avatar'
)
)
);