Hello,

Thank you for writing this module.

I was wondering if there is a way to configure people's pictures/avatars to be displayed in the list view?

Thanks,
Andrey.

Comments

pukku’s picture

Assigned: Unassigned » pukku
Status: Active » Postponed

Hi! Not with the way things are currently done, at least, not easily. One of the previous issues mentions this, briefly, but I can't find it right now.

I may or may not make this work; I have a few ideas for how to make the module better that should be dealt with first; then it would become easier to make the avatar available.

pukku’s picture

Status: Postponed » Active

Hi! Could you run the query SELECT picture FROM users and give me some sample data on how a user's avatar is stored? You don't need to post all the results, but I need to see a little of how it is stored.

Thanks,
Ricky

pukku’s picture

BTW: if you don't have _too_ many users, you can do this with a template of

return theme_user_picture(user_load(array('uid' => $r['@uid'])));

You will need to run eval on this template to get it to work.

I will shortly post an easy way to make your own template columns, but until then, in one of the other tickets (about user roles) I posted simple directions for creating your own local module to make this column available.

HTH,
Ricky

deanypop’s picture

I just want to second/add a vote for avatars in the user list...

A few key additional needs:

1) We need to limit the avatars to the size of the rows, or to otherwise be able to set a max image size for the site user list;

2) Have the images themselves be 'clickable' links to the user's profile.

I did the template fix, but it sizes the pics to their full size, blowing the whole list out of whack. ;)

pukku’s picture

Hi! I just checked in a new version which has support for conditional columns. This should, I think, make avatars possible, so I also added the @picture column to the columns coming from user.module.

If you have avatars, please look at this and see if it works for you.

To fix the size problems, modify the template from

<img src="@_base/@picture" alt="" />

to something like

<img src="@_base/@picture" alt="" height="20" />

(or whatever size you want; you could also do this using a 'style' attribute).

If you want a link to the user's profile, you would surround it with a link like <a href="@_base/user/@uid">. Note that this will not work like the user view column and respect the permissions of the user to view profiles; the link will be inserted regardless (they will get access denied if they don't have permission).

Please give me feedback on this; if this works, I'm going to make this version 5.x-1.0, and move the other feature requests over into this branch.

Thanks,
Ricky

mr.andrey’s picture

Hi Ricky,

I just checked this post since your initial reply. Sorry didn't get back sooner.

Here are the query results you requested (not sure if it's still useful):

files/pictures/picture-1.jpg
files/pictures/picture-2.jpg
files/pictures/picture-4.jpg

files/pictures/picture-6.jpg

I see that in the new version you have the "User Avatar" field option. This is awesome. I put this into the template option to get it to work:
<a href="/user/@uid"><img src="/@picture" alt="" / width="60"></a>

The @_base option was giving me an extra slash in the beginning, so all the img src's were //files/pictures instead of /files/pictures.

This is great,
Thanks!
Andrey.

mr.andrey’s picture

Hey, thought you mind find this interesting.

On my site I'm using imagecache to generate neat square thumbnails for the whole site. This is what I now use for the User Avatar template option:
<a href="/user/@uid"><img src="/files/imagecache/thumb/@picture" alt="" /></a>

"thumb" being an imachecache preset.

This way, all the user avatar thumbnails are in a central place and I can do a site-wide change very easily. Imagecache also makes all the thumbnails one size, so there is no inconsistency between the avatars, since users upload photos of all sorts of dimensions.

Enjoy!
Andrey.

pukku’s picture

Status: Active » Fixed

FWIW, you could probably just do @_base@picture to get the path right, but it looks like you're doing something else anyway...

I'm going to mark this as fixed, as I think this now works...

Ricky

Anonymous’s picture

Status: Fixed » Closed (fixed)