I've installed this module and also the Imagecache Profiles module (5.x-1.4). Everything seems to be working fine as far as the profile picture caching is concerned: when I go to user/1, for example, I see the nice cached user picture, correct size. However, if I send a private message from say user 1 to user 2, and then go I go to user/2/privatemsg to get the message, I see the HUGE, un-resized profile picture of user 1. Is this an issue with this module, or with Imagecache Profiles? Any ideas on how to fix it?

Any help is very much appreciated!

Comments

ron_s’s picture

The theming for the picture resides in the theme_privatemsg_user_picture function. Copy and paste this function into your template.php file, then change the name of the function to be associated with your theme. For example, if using the garland theme, your function name would be garland_privatemsg_user_picture.

Then what you want to do is look for the following code:

    if (isset($picture)) {
      $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
      $picture = theme('image', $picture, $alt, $alt, '', FALSE);
      ...

... and you want to change the $picture line to the following:

    if (isset($picture)) {
      $alt = t("@user's picture", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous'))));
      $picture = theme('user_picture', $account);
      ...

This will use the theming for your user_picture by default, which will be the theming associated with ImageCache if you have ImageCache Profiles installed.

JordanMagnuson’s picture

Status: Active » Closed (fixed)

Thanks so much ron_s!

plan9’s picture

Thanks!!
;)

Flplsx’s picture

Version: 5.x-3.0 » 6.x-1.1
Status: Closed (fixed) » Active

can anyone help with getting this to work in drupal 6.x?

it looks like you'd override the privatemsg_preprocess_privatemsg_view() function, but I don't know nearly enough PHP to do it myself.

Berdir’s picture

Well, what do you want to do?

I just did a short test, enabled all required imagecache modules, did set a preset for profile/comment *and* default, uploaded a profile picture and it is being displayed when viewing a message I wrote.

Berdir’s picture

Status: Active » Postponed (maintainer needs more info)
Flplsx’s picture

How do you select which imagecache preset you want to use for privatemsg?

Thanks for the reply!

Berdir’s picture

There is no custom one for privatemsg (we could create one, but I would have to figure out how), for now, it does use the default preset.

Berdir’s picture

Status: Postponed (maintainer needs more info) » Fixed

I assume the question has been answered, feel free to re-open the issue or create a new one if you have more questions.

Flplsx’s picture

sorry, thought i wrote back.....

thanks! Now to figure out how to make an imagecache preset the default.....

Berdir’s picture

That should be easy. At admin/user/settings, there are 3 options available for me: Profile/Comment and Default picture preset.

Once a preset is set for the "Default picture preset", it should show up correctly on the messages/view page.

Flplsx’s picture

oh man, completely missed that, thanks a ton!

Status: Fixed » Closed (fixed)

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