Drupal: Fix Gravatar support on private message pages

Uploaded user avatars were appearing as expected on private messages, but Gravatars did not render; updated to make private message template consistent with forum comment template as far as how avatars are rendered

https://dev.gridrepublic.org/browse/DBOINCP-264
This commit is contained in:
Tristan Olive 2016-08-19 14:04:09 -04:00
parent fec828843e
commit 3efbd9d0f6
1 changed files with 9 additions and 4 deletions

View File

@ -607,12 +607,17 @@ function boinc_preprocess_views_view(&$vars, $hook) {
*/
///* -- Delete this line if you want to use this function
function boinc_preprocess_privatemsg_view(&$vars, $hook) {
$user_image = boincuser_get_user_profile_image($vars['message']['author']->uid);
if ($user_image['image']['filepath']) {
$author_picture = '<div class="picture">';
$user_image = boincuser_get_user_profile_image($vars['message']['author']->uid);
if ($user_image) {
if (is_array($user_image) AND $user_image['image']['filepath']) {
$author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false);
$author_picture .= '</div>';
}
elseif (is_string($user_image)) {
$author_picture .= '<img src="' . $user_image . '"/>';
}
}
$author_picture .= '</div>';
$vars['author_picture'] = $author_picture;
$vars['message_timestamp'] = date('j M Y H:i:s T', $vars['message']['timestamp']);
}