Created this block which I thought might be useful to others - you can past the code into a block with the php filter enabled (be careful with security / rights) or put it into a module:
<?php
global $user;
$account = user_load($user->uid); //load user, all user fields & fbuid
$fbuid = fbconnect_get_fbuid();
//dpm($user); // uncomment this if you want to see the krumo output & variables of $user
//dpm($account); // uncomment this if you want to see the krumo output & variables of $account
print ('<div class="user_details">');
if ($user->uid == 0){ //not looged in
print ('<div class="user_login">'.l(t('Login') , 'user/login').'</div>');
print ('<div class="user_signup">'.l(t('Signup') , 'user/register').'</div>');
}
//picture details (profile or fbconnect)
else {
print('<div class="user_pic">');
if(!is_null($account->picture)){
$attr = array(
'style_name' => 'thumb', //replace thumb with the imagecache preset you prefer
'path' => $account->picture->uri,
'width' => '50',
'height' => '50',
);
print theme('image_style', $attr);
}
elseif ($fbuid && isset($account->data['fb_avatar']) && $account->data['fb_avatar']) {
print theme('fbconnect_user_picture_override', array('fbuid' => $fbuid, 'account' => $account, 'size' => variable_get('fbconnect_pic_size', $preset), ));
}
print('</div>');
// print links for logout & edit user etc - dpm (see above will tell you what else is avaiable)
print ('<div class="right_details"><div class=user_name>'.l(t($account->name), 'user').'</div>');
print ('<div class="user_edit">'.l(t('Account Settings') , 'user/'.$user->uid.'/edit').'</div>');
print ('<div class="user_mail">'.t($account->mail).'</div>');
print ('<div class="user_logout">'.l(t('Logout') , 'user/logout').'</div></div>');
}
print ('</div>');
?>Hope that helps someone
Comments
Comment #1
ykyuen commentedThanks for the code, but how did u get the $preset variable?
Comment #2
gittosj commentedIm not using fbconnect any more - switched to fboauth since it seems to work much better. That said you can track down what the preset is by looking under your admin/config/people/accounts and it'll be listed under: "Picture display style".
the better solution I'm now using is here:
http://drupal.org/node/1440346
Comment #2.0
gittosj commentedremoved site-specific code