You are here

function fbconnect_login_theme_user_picture_override in Facebook Connect 7.2

Same name and namespace in other branches
  1. 8.2 fbconnect_login/fbconnect_login.module \fbconnect_login_theme_user_picture_override()

Our replacement for theme('user_picture', ...)

1 string reference to 'fbconnect_login_theme_user_picture_override'
fbconnect_login_theme_registry_alter in fbconnect_login/fbconnect_login.module
Implements hook_theme_registry_alter().

File

fbconnect_login/fbconnect_login.module, line 375
Login functionality for Facebook Connect module

Code

function fbconnect_login_theme_user_picture_override($variables) {
  $account = $variables['account'];

  // manually set in nodeapi or comments
  if (isset($account->fbconnect_picture_preset)) {
    $preset = $account->fbconnect_picture_preset;
  }
  else {

    // Default user picture preset.
    $preset = variable_get('fbconnect_pic_size', 'square');
  }
  $fbuid = _get_user_fbuid($account->uid);

  // First learn the Facebook id
  $user_url = url('user/' . $account->uid);
  if ($fbuid && isset($account->data['fb_avatar']) && $account->data['fb_avatar']) {
    $output = theme('fbconnect_login_user_picture_override', array(
      'fbuid' => $fbuid,
      'account' => $account,
      'user_url' => $user_url,
      'size' => variable_get('fbconnect_pic_size', $preset),
    ));
  }
  else {
    $output = theme('fbconnect_login_user_picture_orig', array(
      'account' => $account,
    ));

    // Markup without fb_connect.
  }
  return $output;
}