Posted by alex.k on November 1, 2008 at 5:43pm
| Project: | User Relationships |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | alex.k |
| Status: | closed (fixed) |
Issue Summary
Porting the solution of #222582: How to add user picture to my relationships block to 6.x.
Comments
#1
Committed to CVS. This is off by default, controlled by a checkbox in /admin/user/relationships/settings.
#2
Automatically closed -- issue fixed for two weeks with no activity.
#3
Hi alex, how did you configured the content profile/ user profile? 'Cause I tried the same but it doesn't work out for me. any advice?
#4
This feature doesn't use content profile or profile.module. It's the standard drupal user picture that gets shown.
#5
Add user pictures to My relationships block it works only on my relationship pages, how it will also work my relationship block ...could u have any track???
#6
Has anyone figured how to do this yet so it can be added to a panel.
#7
I used some theming tricks to do this. basically, I added the UID to the view, then in a theme override file for the field, I use that UID to load information, get the picture and display it through imagecache.
Effective and an excellent trick for getting things done if you want to have a manual handle on your code.
[code]
<?php$fanuser = user_load ( array( 'uid' => $view->result[$id - 1]->users_user_relationships_uid ));
if ( empty ( $fanuser->picture )):
//set a default picture if it's empty
$fanuser->picture = 'files/blank_profile_pic.jpg';
endif;
$avatar = theme( 'imagecache', 'image_teaser', $fanuser->picture );
print l($avatar, 'user/'. $view->result[$id - 1]->users_user_relationships_uid , array( 'html' => 'true' , 'attributes' => array('alt' => $node->title, 'title' => $node->title )));
?>
[/code]
#8
@nimzie
are you saying that for each UID in the list, you are using user_load? Isn't user_load very expensive from load perspective? There may be simpler/less expensive ways to get user pictures?
#9
@ajayg - I'm sure there is - but i'm not sure of the best way to do that. The user object is quite large, and I'm sure Drupal has to do some extensive work to build it. Any advice would be great, thanks.
#10
OG (organic groups) module handles pictures of group members using view and view has builtin field to display pictures in block. So I am hoping some code there could be leveraged or the view reused/repurposed.
#11
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
Hi there and sorry for opening this again,
In order to show user pictures in User Relationships: friends block, can we use code from #7 to achieve this?
And as ajayg said, do we have any other solution more efficient than using user_load?
#14
#15
Hey alex,
Are you saying there is currently no way to display a user's picture from a content_profile instead of the default user image?
#16
Why, you can show pictures from content_profile if you build the block in Views. It's more of a content_profile question than a UR one.
#18
Automatically closed -- issue fixed for 2 weeks with no activity.