when u install twitte_ signin module.we cant display avatar form twitter'server
this code for show twitter'user avatar
function twitter_signin_preprocess_user_picture(&$variables) {
$variables['picture'] = '';
if (variable_get('user_pictures', 0)) {
$pic_url = '';
$account = $variables['account'];
$pic_url = ereg_replace("_normal.","_bigger.",db_result(db_query("SELECT profile_image_url FROM {twitter_account} WHERE uid= %d", $account->uid)));
if (!empty($account->name) && !empty($pic_url)) {
$picture = $pic_url;
} elseif (!empty($account->picture) && file_exists($account->picture)) {
$picture = file_create_url($account->picture);
}
elseif (variable_get('user_picture_default', '')) {
$picture = variable_get('user_picture_default', '');
}
if (isset($picture)) {
$alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
$variables['picture'] = theme('image', $picture, $alt, $alt, '', FALSE);
if (!empty($account->uid) && user_access('access user profiles')) {
$attributes = array('attributes' => array('title' => t('View user profile.')), 'html' => TRUE);
$variables['picture'] = l($variables['picture'], "user/$account->uid", $attributes);
}
}
}
}
I hope u include this code into twitter(module) project too.thank you
@xenatt
Comments
Comment #1
mchelenIt didn't seem to work, but here is a patch (relative to root project directory) for anyone that wants to try it.
Comment #2
xenatt commentedI already write module for personal use if u want get one.
Comment #3
yngens commentedexcellent, xenat! i have installed your module and it works perfectly, thank you.
Comment #4
greg.harveyMarking as 'needs review' to get the maintainers' attention. For me this either needs to be on the roadmap for Twitter or released as a sub-module with its own project page. The latter might be better, but we should hear wise words from the Twitter maintainers before deciding. =)
Comment #5
xenatt commentedthis modules (twitter avatar) dont have admin setup page.
twitter project ,I'm not owner. if twitter(modules)'s Owner want to include twitter avatar modules into main modules.
I will be say "thank U". :)
Comment #6
blackspiraldancer commenteddependencies[] = oauthis unnecessary (as it's already a dependance of signin) and a game blocker (the dependant module is "oauth" and not "oAuth", so it won't be found).After removing that line, the module works fine (the image is imported and displays correctly), but the imported image won't show up in the user account's preferences under "profile picture" (it still shows just "load picture").
Comment #7
fenda commentedAny updates on this? It should be part of the twitter_signin module but have an admin setting to turn functionality on/off.
Comment #8
lyricnz commentedI'll repost a comment I put on another issue:
There are a few issues around caching the profile image for twitter accounts locally, as well as integrating these local images into profile. These seem to be two separate things:
1) creating a local copy of the profile image for each twitter account (that can be imagecache processed etc)
2) integrating that local copy into the user profile image capability
It sounds like they can be implemented separately, in that order.
Comment #9
lyricnz commentedSolved #8 part 1 with imagecache_external and #1828732: Allow local caching/processing of profile images
Comment #10
13rac1 commentedThere is some work on #8 part 2 at #1840298: Import Twitter picture, but it needs work. I think it and #1828732: Allow local caching/processing of profile images cover everything for this issue. Re-open as needed.