[support] How do I load a user's profile image

Alexander Arul alexander.arul at gmail.com
Mon Aug 17 14:10:38 UTC 2009


Thanks Seth, I'll try this tomorrow and let you know if it works.

Cheers
Alex

On Mon, Aug 17, 2009 at 10:02 PM, Seth Freach <sfreach at gmail.com> wrote:

>  Alexander,
> Picture location is a field in the $user object.  This will probably get
> you what you're looking for:
>
> <?php
> global $user;
> $img_tag = '<img src="' . base_path() . $user->picture . '" />';
> ?>
>
> If you need a function to call, you could just wrap the above in a function
> that takes a uid parameter and do a user_load on it instead of using the
> global $user object.
>
> -Seth
>
> Alexander Arul wrote:
>
> Hi all,
>
> I want to generate the user's picture path using code. I thought there
> might be an API function like *function user_image_path($uid)*, but
> nothing like that so far .. please point me in the right direction, thanks
> :)
>
> Cheers
> Arul*  *
>
> ------------------------------
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.drupal.org/pipermail/support/attachments/20090817/89063214/attachment.htm>


More information about the support mailing list