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

mchelen’s picture

StatusFileSize
new1.46 KB

It didn't seem to work, but here is a patch (relative to root project directory) for anyone that wants to try it.

xenatt’s picture

StatusFileSize
new1.09 KB
new1.09 KB

I already write module for personal use if u want get one.

yngens’s picture

excellent, xenat! i have installed your module and it works perfectly, thank you.

greg.harvey’s picture

Title: patch : module ? for twitter (project) avatar show » Sub-module for showing Twitter avatars with Drupal profiles - include in the main Twitter package?
Status: Patch (to be ported) » Needs review

Marking 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. =)

xenatt’s picture

this 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". :)

blackspiraldancer’s picture

dependencies[] = oauth is 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").

fenda’s picture

Any updates on this? It should be part of the twitter_signin module but have an admin setting to turn functionality on/off.

lyricnz’s picture

I'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.

lyricnz’s picture

Solved #8 part 1 with imagecache_external and #1828732: Allow local caching/processing of profile images

13rac1’s picture

Status: Needs review » Closed (duplicate)

There 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.