I am using this method http://agaricdesign.com/note/theming-user-profile-pictures-drupal it seems to be working ok so far my only problem is that on only profile page I would like to show the large image "userpic_large"

if I change the function phptemplate_user_picture($account, $size = 'userpic_thumb') to===> function phptemplate_user_picture($account, $size = 'userpic_large')

it also changes the "User: Author Picture" to the userpic_large but i would like to keep it userpic_thumb.

Thanks for your time.

Comments

naurisr’s picture

Replace [themename] with the name of your theme or phptemplate

function [themename]_user_profile($account, $fields) {
  $output = '<div class="profile">';
  $output .= theme('user_picture', $account, 'userpic_large');
  foreach ($fields as $category => $items) {
    if (strlen($category) > 0) {
      $output .= '<h2 class="title">'. check_plain($category) .'</h2>';
    }
    $output .= '<dl>';
    foreach ($items as $item) {
      if (isset($item['title'])) {
        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .'</dt>';
      }
      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
    }
    $output .= '</dl>';
  }
  $output .= '</div>';

  return $output;
}

werushka’s picture

the above code still shows larger image on user profile page and also views filed

function acta_user_profile($account, $fields) {
  $output = '<div class="profile">';
  $output .= theme('user_picture', $account, 'userpic_large');
  foreach ($fields as $category => $items) {
    if (strlen($category) > 0) {
      $output .= '<h2 class="title">'. check_plain($category) .'</h2>';
    }
    $output .= '<dl>';
    foreach ($items as $item) {
      if (isset($item['title'])) {
        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .'</dt>';
      }
      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
    }
    $output .= '</dl>';
  }
  $output .= '</div>';

  return $output;
}
naurisr’s picture

They must me:
function phptemplate_user_picture($account, $size = 'userpic_thumb')

werushka’s picture

:( no luck this still shows large images on views field and profile page

function phptemplate_user_profile($account, $fields) {
  $output = '<div class="profile">';
  $output .= theme('user_picture', $account, 'userpic_large');
  foreach ($fields as $category => $items) {
    if (strlen($category) > 0) {
      $output .= '<h2 class="title">'. check_plain($category) .'</h2>';
    }
    $output .= '<dl>';
    foreach ($items as $item) {
      if (isset($item['title'])) {
        $output .= '<dt class="'. $item['class'] .'">'. $item['title'] .'</dt>';
      }
      $output .= '<dd class="'. $item['class'] .'">'. $item['value'] .'</dd>';
    }
    $output .= '</dl>';
  }
  $output .= '</div>';

  return $output;
}
naurisr’s picture

I would like to look at source of function phptemplate_user_picture also

P.S. Try to clear cache

werushka’s picture

where can i locate that function

naurisr’s picture

from http://agaricdesign.com/note/theming-user-profile-pictures-drupal
STEP 4
Paste this code into your template.php file.

    function phptemplate_user_picture($account, $size = 'userpic_thumb') {
      if (variable_get('user_pictures', 0)) {
        // Display the user's photo if available
        if (preg_match('/q\=user\/\w+/', $_SERVER['REDIRECT_QUERY_STRING'])) {
            $size = 'userpic_large';
        }
         if ($account->picture && file_exists($account->picture)) {
          $picture = l(theme('imagecache', $size, $account->picture), 'user/' . $account->uid, NULL, NULL, NULL, FALSE, TRUE);
        }
        else if (variable_get('user_picture_default', '')) {
          $picture = l(theme('imagecache', $size, variable_get('user_picture_default', '')), 'user/' . $account->uid, NULL, NULL, NULL, FALSE, TRUE);
         
                
        }
        return '<div class="picture">'.$picture.'</div>';
      }
    }
werushka’s picture

I already done this part but this is the code that is not working.

naurisr’s picture

Make sure that the size parameter of that function is 'userpic_thumb' (not 'userpic_large' as you described in your initial post)

suryanto’s picture

I have no problem with Agaric Way. Have you inserted proper setting in imagecache?

Regards,
Suryanto Rachmat
http://rachmat.net

werushka’s picture

yes i am positive because I can see the thumb and if i change it to large than i see the large image.

werushka’s picture

The below change worked.

Then change this line:
"if (preg_match('/q\=user\/\w+/', $_SERVER['REDIRECT_QUERY_STRING'])) {"

to this

"if (preg_match('/q\=users\/\w+/', $_SERVER['REDIRECT_QUERY_STRING'])) {"

("user" becomes "users").

Payment sent to http://drupal.org/user/1920

flevour’s picture

This was because some renaming (pathauto maybe?) was going on. I was informed the typical URL for user page was "/users/$USERNAME".
Cheers,
flevour
---------------------------
http://flevour.net