Multiple user profile pictures on user profile page

txcrew - February 3, 2008 - 06:49
Project:ImageCache Profiles
Version:5.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Greetings,

Thanks for creating such a module. I've been looking for an easy way to achieve this functionality for a long time now.

For me, the module is working as advertised but, I have sort of a unique setup where I have multiple user profile pictures used displayed on the user profile page (user picture at top, view of buddy list and comments). I am using the advanced profile and panels 2 module to achieve this.

Is there a way to only resize a user picture in a certain class or ID? Or perhaps another solution?

TIA,
txcrew

#1

v1nce - February 3, 2008 - 16:50
Status:active» duplicate

I've created a patch that incorporates the comments module so you can use a different imagecache preset to resize user pictures within comments.

When time permits, I can incorporate other modules like buddy lists or blocks so we can resize the user picture depending on where it is being displayed. I also welcome any patches for this functionality.

You can grab the patch for the comments module here.

#2

oscully - April 4, 2008 - 04:47

I fixed this by adding a few lines to the imagecache_profile.module file. I don't have the time to put a patch together right now, so here's what I did:
Find this:

      // If on user profile page
      if (arg(0) == 'user' && is_numeric(arg(1))) {
        $query = db_query('SELECT presetname FROM {imagecache_preset} WHERE presetid = %s', variable_get('user_picture_imagecache_profiles', 0));
        $size = db_result($query, '0');
      }
}

change it to:
    if (variable_get('user_picture_imagecache_profiles', 0)) {
      // If on user profile page
      if (arg(0) == 'user' && is_numeric(arg(1))) {
        $query = db_query('SELECT presetname FROM {imagecache_preset} WHERE presetid = %s', variable_get('user_picture_imagecache_profiles', 0));
        $size = db_result($query, '0');
      }
      // If in a guestbook
      if ($account->cid) {
$size = db_result($defaultquery, '0');
      }
    }

All this does is make the image size for comments the same as the default. If your default is thumbnail sized this should work for you.

#3

etcetera9 - July 28, 2009 - 08:20

This code doesnt work for me. I am using Guestbook 1.1 and Drupal 6. Is there any difference in Drupal 6 regarding this code? But I dont think so. Are you sure you can check if the picture is on a guestbook entry by if ($account->cid) ??

Thanks,

Sinan

 
 

Drupal is a registered trademark of Dries Buytaert.