I'm having problems accessing the avatars from myspace, facebook and twitter. Im using Drupal 6 and the latest cvs of gigya socialize. What I'm simply trying to accomplish is to make the User picture check to see if there is a social avatar and use that avatar. Something like this will get the string of the avatar (in this example from twitter) if it exists from the $account var:

$arr = $account->content;
$pic = $arr["user_picture"]["#value"]; // here is the user picture i'd like to replace
if isset($arr["gigya"]["twitter"]["bio"]["#value"]) {
$twitter_html = $arr["gigya"]["twitter"]["bio"]["#value"]; // can substitute facebook and MySpace here
$twit = strstr($twitter_html, "http"); // returns everything starting from http
$twitt = strstr($twit, '"'); // returns everything after the ending " (also removes the ")
$twitter_pic = str_replace($twitt, "", $twit); // now we have the http string of the twitter pic (without quotes)
}

So I've tried theming using yourtheme_preprocess_user_picture in template.php with no success. If anyone could provide some guidance it would be awesome as this is driving me mental. I realize there are TOS for caching user profile info fetched from social sites, but I would simply address that as part of the registration process. I'm also using image cache and would also like to incorporated avatar selection module. In an ideal world, the user would register with a social network, choose first if they want to use that avatar for drupal, if not they can choose one from avatar selector or upload their own. Even cleaner would be to place the social avatar within one of the available avatars in avatar selector.

Also I can't seem to figure out how to pre-populate User fields with social network data. Huge thanks to anyone who can help. I am of course trying to accomplish this through theming unless there's another way.

-wil

Comments

EvanDonovan’s picture

Version: 6.x-1.x-dev » 6.x-2.0
Status: Active » Postponed (maintainer needs more info)

Try again on 2.0 with #742430: Patch to fix several bugs and let us know if it works. The prepopulation should work now.

azinck’s picture

Prepopulation of social network info works but the current version of the module (even with #742430: Patch to fix several bugs ) doesn't support avatars.

EvanDonovan’s picture

Title: Gigya avatar issues » Add Avatar features into Gigya
Category: support » feature

Postponing for now, but should be on the roadmap. (I haven't created that issue yet.)

EvanDonovan’s picture

Status: Postponed (maintainer needs more info) » Active
EvanDonovan’s picture

Title: Add Avatar features into Gigya » Use Gigya's Avatar field to control user profile picture (was: Add Avatar features into Gigya)
Version: 6.x-2.0 » 6.x-2.x-dev

For Facebook, this can be done quite easily in a preprocess function using the following two lines of code, assuming that $fbuid (the Facebook user ID) is already known:

$alt = t("@user's picture", array('@user' => $account->name));
$vars['user_picture'] = theme('image', 'http://graph.facebook.com/' . $fbuid . '/picture', $alt, $alt, '', FALSE);

This uses the new Facebook Open Graph API which exposes much more data in a much simpler way than previous Facebook APIs.

Does Gigya store the Facebook user ID for a given user somewhere? If so, this method could easily solve this problem. Of course, other social network services would require different functions.

gambaweb’s picture

Status: Active » Closed (fixed)

Please reopen if still relevant.