Use a default profile picture

Public

Get raw version
php
  1. <?php
  2.  
  3. $default_avatar = variable_get('default_profile_picture', ''); // Get the default picture URI
  4.  
  5. $user = user_load($entity->uid);
  6.  
  7. $avatar = theme_image_style(array(
  8. 'style_name' => 'cc_avatar',
  9. 'path' => $user->picture ? $user->picture->uri : $default_avatar,
  10. 'width' => 45,
  11. 'height' => 45,
  12. 'attributes' => array(
  13. 'class' => 'media-object img-circle pull-left'
  14. )
  15. ));