In the profile page, when buddylist module is enabled, it shows the list
of persons. How to add the userphotos here just like in posts / comments ?

The portion of the code in buddylist is


if ($type == 'view' && user_access('view buddy lists')) {
// if thisuser has friends, show friends
$cnt = variable_get('buddylist_prof_buddies', 5);
$i = 0;
if ($buddies = buddylist_get_buddies($thisuser->uid)) {
foreach(array_keys($buddies) as $buddy) {
$account = user_load(array('uid' => $buddy));
$listbuddies[] = $account;
$i++;
if ($i > $cnt) {
break;
}
}
$output[] = array('title' => t('%Buddies', buddylist_translation()), 'value' => theme('user_list', $listbuddies), 'class' => 'buddylist',);
}

Can someone kindly say what to add / alter here so that the photos also show up ?

Comments

misty3’s picture

any help ?

ewebfoot’s picture

I use a custom user profile (user_profile.tpl.php) but this is the code I use to get buddy pictures although it only shows two buddies =(
Hope this helps in any way
goodluck

if ( user_access('view buddy lists') || user_access('administer users') ) {
    // if thisuser has friends, show friends
    $output = '';
    $i = 0;
    $cnt = variable_get('buddylist_prof_buddies', 2);
    if ($buddies = buddylist_get_buddies($user->uid)) {
      foreach(array_keys($buddies) as $buddy) {
        $account = user_load(array('uid' => $buddy));
        $output .=theme('user_picture', $account);
                $listbuddies[] = $account;
        $i++;
        if ($i > $cnt) {
          break;
        }
      }
      $output .= '</div>';
    if (count($buddies) > variable_get('buddylist_prof_buddies', 1)) {
      $output .= '</td></tr><tr><td>';
	  $output .= '<a href="?q=buddylist/'; $output .= $user->uid; $output .= '">View All Friends</a>';
    }
	else {
	  $output .= '</td></tr><tr><td>';
	}
   
    print $output;
    }
}