fetching user photo or image URL i am trying to fetch loged in users photo to make a welcome block. i have applied a code which is not working

$userphoto = $user-&gt;picture;


so what to do to fetching user photo or image URL, any idea?
The picture property of the user entity is the file ID (a reference to the fid column in the file_managed table).

You can load the file explicitly with file_load() like so:

$file = file_load($user-&gt;picture);


And render it to an image using theme_image():

$image = theme('image', array(
  'path' =&gt; $file-&gt;uri,
  'alt' =&gt; 'Some alt',
  // etc...
));


Alternatively you could dispense with the above and just use the handy theme_user_picture() function:

$image = theme('user_picture', array('account' =&gt; $account));