Add user pictures to My relationships block.....

alex.k - November 1, 2008 - 17:43
Project:User Relationships
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:alex.k
Status:closed
Description

Porting the solution of #222582: How to add user picture to my relationships block to 6.x.

#1

alex.k - November 1, 2008 - 17:45
Status:active» fixed

Committed to CVS. This is off by default, controlled by a checkbox in /admin/user/relationships/settings.

AttachmentSize
User pictures on my relationships page 63.06 KB
New config checkbox 11.36 KB

#2

Anonymous (not verified) - November 15, 2008 - 17:51
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#3

michaeldrupal - May 25, 2009 - 22:58
Status:closed» active

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

alex.k - May 25, 2009 - 23:06

This feature doesn't use content profile or profile.module. It's the standard drupal user picture that gets shown.

#5

drupal mind - July 17, 2009 - 10:45
Title:Add user pictures to My relationships page» Add user pictures to My relationships block.....

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

venusrising - August 6, 2009 - 11:21

Has anyone figured how to do this yet so it can be added to a panel.

#7

nimzie - August 26, 2009 - 19:30

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

ajayg - August 31, 2009 - 03:02

@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

nimzie - September 8, 2009 - 11:50

@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

ajayg - September 8, 2009 - 16:14

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

alex.k - October 24, 2009 - 19:16
Status:active» fixed

#12

System Message - November 7, 2009 - 19:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.