Can't get the author's picture printed onto a node in Drupal 7 After reading the documentation, it seems that the correct way of doing that is like this:

php print $user_picture;


It won't work (it doesn't print anything at all).

Afetr asking around, I get this answer, which sadly won't work either:

global $user;
$image = theme('user_picture', $user);
print $image


That code was suggested as a "last resource", but when I try to use it, I get this error message:


  Fatal error: Cannot use object of type stdClass as array in /includes/theme.inc on line 1054


Line 1054 is the following one:

  // Line 1054
  if (isset($variables['#theme']) || isset($variables['#theme_wrappers'])) {
  // 
    $element = $variables;
    $variables = array();
    if (isset($info['variables'])) {
      foreach (array_keys($info['variables']) as $name) {
        if (isset($element["#$name"])) {
          $variables[$name] = $element["#$name"];
        }
      }
    }


It´s pretty clear that it should work, but it doesn't.

Using contemplate module, I get this output as an alternative, but it doesn't work either.

&lt;?php print $node-&gt;picture ?&gt;


I've tried then with Devel module (using the /devel tab of the node):

I get this:

picture (String, 4 characters ) 2876
$...-&gt;picture


Wich won't work, because the output is just "2876", but is the only "picture" there.

So what can I do? How can I trace this problem?
Have you tried examining the $user object itself? It should be something like 

    &lt;?php
    global $user;
    print $user-&gt;picture;
    ?&gt;


Or if that is loading the logged in user(which it will) as opposed to the user(creator of the node) you are viewing try on a node:

&lt;?php
$user_object = user_load($uid));
print $user_object-&gt;picture;
?&gt;