Redirecting user links to their profile2 pages I'm using the profiles2 module for my user profiles.  I want to keep the user accounts hidden, and instead, use the profiles for public viewing.  I disabled user pictures in users, and added an image field to the profile entity.  When users post comments, the links point back to the user account.  How can I change that behavior so links point back to that user's profile page?  Also, how can I display the profile pics for these comments?  Essentially, I'm wanting the normal user functionality to occur with profiles instead of users.
This can be done with a combination of

hook_preprocess_username (make links go to profile path)

Something like:

function MYTHEME_preprocess_username(&amp;$variables) {
  $account = $variables['account']
  if($profile = profile2_load_by_user($account, 'profile_type')){
    // This gets passed onto theme_username
    $variables['link_path'] = 'user/' . $variables['uid'].'/profile/path';
    // Possibly:
    // $type = $profile-&gt;type();
    // $path = profile2_page_get_base_path($type) . '/' . $account-&gt;uid
  }
}


and then the picture override in 

hook_preprocess_user_picture (override user picture)

Something like:

function MYTHEME_preprocess_user_picture(&amp;$variables) {

  $account = variables['account'];
  if($profile = profile2_load_by_user($account, 'profile_type')){
    // You could use a custom 'display' parameter, e.g image_style
    $image = field_view_field('profile2', $profile, 'field_image');
    $variables['user_picture'] = render($image);
  }

}