I'm trying to wrap the author picture in an Imagecache preset in privatemsg-view.tpl.php. After looking at the available variables, it looks like the appropriate variable for this would be $message->author['picture'], but this is not working.

Can someone tell me which author picture variable I would use in the theme function?

Comments

naheemsays’s picture

Have you looked at $author_picture ?

atelier’s picture

The $author_picture variable doesn't work. I need to access the raw author picture variable so that I can plug it into the Imagecache theme function:

i.e. print theme('imagecache', 'preset_namespace', $variable, $alt, $title, $attributes);

naheemsays’s picture

try $vars['message']['author']->picture

atelier’s picture

Status: Active » Fixed

That almost worked. :)

After a little more experimentation, I was able to successfully call the variable with:
$message['author']->picture

Thank you very much for your help.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

BIGREDPAUL’s picture

This looks like what I'm looking for but I'm stuck. I think I'm updating the right line

$vars['author_picture'] = theme('user_picture', $message['author']);

changing it to

$vars['author_picture'] = theme('user_picture', $message['author']->picture);

This is in the privatemsg.module.php file.
1. Am I in the right place
2. Is there another file or line I need to upgrade.

Whoops add on.
This thread is to wrap the photo in a box I take it. I'm just trying to use the image cache to resize the image. Am I in the wrong place.
Thanks
My wife wears an I'm with stupid t-shirt because she likes the colours.