Hi Kenuck, while porting a module called ImageCache Profiles I ran into a little problem. The aim of the ImageCache Profiles module is to provide consistent sizes throughout the site of the "user_picture". It does so by overriding the preprocess_user_picture in user.module. I realize in your module you also use this function, but since it is called independently the process to use the correct profile image is overlooked. I solved it by altering the following in friends.theme.inc:

<?php
// Line 41 Preprocess template for corkboard message
$variables['picture'] = theme('image',$picture, $alt, $alt, '', FALSE);

// to this:
$variables['picture'] = theme('user_picture', $account);

// Line 80 Preprocess template for friend
$profile_img = theme('image', $picture, $alt, $alt, '', FALSE);

// to this:
$profile_img = theme('user_picture', $account);
?>

These changes would also have to be reflected in the tpl files. Now, I don't know if there are objections to doing it this way, but it seems to have solved the problem. I guess, because the picture is taken from the account after it has been processed by the preprocess?

What do you think, is this something that could be committed?

Regards,

Marius

Comments

mariusooms’s picture

Sorry, there is a small typo. On line 80 there should be 'friend' instead of 'account' for the Friend function, so:

<?php
// Line 41 Preprocess template for corkboard message
$variables['picture'] = theme('image',$picture, $alt, $alt, '', FALSE);

// to this:
$variables['picture'] = theme('user_picture', $account);

// Line 80 Preprocess template for friend
$profile_img = theme('image', $picture, $alt, $alt, '', FALSE);

// to this:
$profile_img = theme('user_picture', $friend);
?>

Regards,

Marius