? 339052_meez_panels.patch Index: meez.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/meez/meez.module,v retrieving revision 1.2.2.4 diff -u -p -r1.2.2.4 meez.module --- meez.module 7 Jul 2008 22:00:26 -0000 1.2.2.4 +++ meez.module 4 Dec 2008 00:32:40 -0000 @@ -35,8 +35,6 @@ function meez_menu($may_cache) { return $items; } - - /** * Implementation of meez_admin_settings form. */ @@ -60,8 +58,6 @@ function meez_admin_settings() { '#description' => t('The avatar to show on the user profile page (e.g. user/1). Leave blank to disable this feature.'), ); - - } return system_settings_form($form); } @@ -70,7 +66,6 @@ function meez_admin_settings() { * Implementation of hook_user */ function meez_user($op, &$edit, &$account, $category = NULL) { - // Load avatars from MEEZ in case there was a change. switch ($op) { case 'register': @@ -87,36 +82,50 @@ function meez_user($op, &$edit, &$accoun break; case 'view': if (strlen(variable_get('meez_avatar_user_page', 'body_sm'))) { - if ($account->avatars[variable_get('meez_avatar_user_page', 'body_sm')]->src) { - $picture = $account->avatars[variable_get('meez_avatar_user_page', 'body_sm')]->src; - } - else if (variable_get('user_picture_default', '')) { - $picture = variable_get('user_picture_default', ''); + + $picture = meez_get_avatar($account); + 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); } + + $item = array('title' => '', + 'value' => $picture, + 'class' => 'picture', + ); - if (isset($picture)) { - $alt = t("@user's profile", array('@user' => $account->name ? $account->name : variable_get('anonymous', t('Anonymous')))); - $picture = theme('image', trim($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); - } - - $item = array('title' => '', - 'value' => $picture, - 'class' => 'picture', - ); - $fields['Meez Avatar']['meez_subfield'] = $item; - - return $fields; - } - else { - return; - } + $fields['Meez Avatar']['meez_subfield'] = $item; + return $fields; + } + else { + return; } - break; } - +} + +function meez_get_img($account) { + if ($account->avatars[variable_get('meez_avatar_user_page', 'body_sm')]->src) { + $picture = $account->avatars[variable_get('meez_avatar_user_page', 'body_sm')]->src; + } + else if (variable_get('user_picture_default', '')) { + $picture = 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', trim($picture), $alt, $alt, '', FALSE); + } + return $picture; +} + +/** + * Implementation of hook_preprocess_author_pane(). + */ +function meez_preprocess_author_pane(&$variables) { + // The full user object for the author + $account = $variables['account']; + + $variables['meez_avatar'] = meez_FUNCTION_TO_GET_AVATAR_HERE($account); } /** @@ -134,7 +143,6 @@ function meez_get_avatars($av_username=" return ($avatars); } - /** * Connect with http://www.meez.com and get a user's meez avatar based on his/her meez username */