diff --git a/README.txt b/README.txt index e7b8d16..d55634d 100644 --- a/README.txt +++ b/README.txt @@ -31,25 +31,33 @@ of avatars that should be imported. 3. You MUST alter your theme to include the meez avatar. A simple example of theme integration is to add this to your template.php: -function THEMENAME_user_meez($account,$version) { - if ($account->avatars[$version]->src) { - $picture = $account->avatars[$version]->src; +function THEMENAME_user_meez($account,$version) { + $imgattr = array('class'=>'picture'); + $data = unserialize($account->data); + if (isset($data['avatars'][$version])) { + $avatar = $data['avatars'][$version]; + $imgsrc = trim($avatar->src); + $imgattr['width'] = $avatar->width; + $imgattr['height'] = $avatar->height; } - else if (variable_get('user_picture_default', '')) { - $picture = variable_get('user_picture_default', ''); + else { + $imgsrc = variable_get('user_picture_default', ''); } - if (isset($picture)) { - $alt = t("@user's profile", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous')))); - $picture = theme('image', $picture, $alt, $alt, '', FALSE); - - if (!empty($account->uid) && user_access('access user profiles')) { - $picture = l($picture, "user/$account->uid", array('title' => t("View @user's profile.", array('@user' => $account->name))), NULL, NULL, FALSE, TRUE); + if (isset($imgsrc)) { + $picture = theme('image',$imgsrc,'avatar','',$imgattr,FALSE); + if (isset($account->name)) { + $name = $account->name; + $alt = t("@user's profile", array('@user' => $name)); + if (!empty($account->uid) && user_access('access user profiles')) { + $picture= l($picture, "user/$account->uid", + array('alt' => $alt, 'title' => $alt, 'html'=>TRUE)); + } } - return '