Hello again.

I'm embedding a third party forum into Drupal, and want to use the User-selected Drupal Avatar in the forums. I can do this on another of my drupal installations which does not have Avatar Selection installed by referencing the /files/pictures/picture-.jpg in the forum template. But I can't determine how Avatar Selection saves the user picture selected. I would think it would copy the selected avatar to /files/pictures/ using the user Id as the identifier, but it's not.

Any easy way I can identify the user picture from a third party app when all I have is the user ID?

Thanks!

Jeff

Comments

stella’s picture

Assigned: Unassigned » stella
Status: Active » Fixed

You can identify the image being used as the user's avatar by looking at the "picture" column in the "users" table in your site's drupal database. The "pictures" directory is only for user uploaded images.

Cheers,
Stella

Steel Rat’s picture

Trying to figure out the best way to do this. I looked through the avatar_selection.module to see when the picture selection was being stored, but saw no reference to the picture field as anything other than part of an array variable.

stella’s picture

The avatar selection module doesn't write to the users table. It just modifies the core drupal form which is processed by drupal core, so you won't see any reference to it in the avatar selection code. If you want to look at this code, you will have to look at drupal's "modules/user/user.module".

The global $user->picture variable will give you the path to the avatar image. If you don't have that variable, or you want to do it for a user that isn't the current logged in user, you can get a user object like:

$my_user = user_load(array("uid" => 123));
$my_pic = $my_user->picture;

Cheers,
Stella

Anonymous’s picture

Status: Fixed » Closed (fixed)