I'm simply trying to make the buddy_api_buddylist of buddylist 2 show user pictures along with the user name. It works for buddy_api_my_buddylist when I add "User: Author Picture" as a field. Somehow I can't seem to alter buddy_api_buddylist to do the same. I'm also making buddy_api_buddylist display in a block instead of a page, which works fine. I'd appreciate any help as I'd really prefer to use BL2 over BL. I love the shortest route feature as well.

CommentFileSizeAuthor
#5 buddies.jpg4.76 KBtelefunken

Comments

mariusooms’s picture

After many hours of fiddling I figured it out...for anybody needing this code here's the import code for views. Make sure not to include the opening and closing tags when importing into views.

  $view = new stdClass();
  $view->name = 'Buddies';
  $view->description = 'Buddies of the given user';
  $view->access = array (
);
  $view->view_args_php = 'global $user;
// Make the first argument the uid of the current user if not already set
if(arg(0) == "user" && is_numeric(arg(1))){
  $args[0] = arg(1);
}else{
  $args[0] = $user->uid;
}
return $args;';
  $view->page = FALSE;
  $view->page_title = '';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'node';
  $view->url = '';
  $view->use_pager = FALSE;
  $view->nodes_per_page = '0';
  $view->block = TRUE;
  $view->block_title = 'Buddies';
  $view->block_header = '';
  $view->block_header_format = '3';
  $view->block_footer = '';
  $view->block_footer_format = '3';
  $view->block_empty = 'You have not yet added any buddies';
  $view->block_empty_format = '3';
  $view->block_type = 'list';
  $view->nodes_per_block = '10';
  $view->block_more = TRUE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'node',
      'field' => 'created',
      'sortorder' => 'DESC',
      'options' => 'normal',
    ),
  );
  $view->argument = array (
    array (
      'type' => 'buddylist2_buddies',
      'argdefault' => '7',
      'title' => '',
      'options' => '',
      'wildcard' => '',
      'wildcard_substitution' => '',
    ),
  );
  $view->field = array (
    array (
      'tablename' => 'users',
      'field' => 'uid',
      'label' => '',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'node',
      'field' => 'type',
      'operator' => 'OR',
      'options' => '',
      'value' => array (
  0 => 'usernode',
),
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(node, users);
  $views[$view->name] = $view;
mariusooms’s picture

Status: Active » Fixed

I'm marking this fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

sharique’s picture

Thanks

telefunken’s picture

StatusFileSize
new4.76 KB

i get a black point at the left bottom side of the picture...how can i get rid of it?

nodestroy’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

maybe you can post your source code for this section of your page

telefunken’s picture

i just imported the code above to views without at the beginning and at the end using 5.x-1.0-beta2.
after enabling the block i get the attached result >>> buddies.jpg.

(thanks for the great module, dominik!!!)

telefunken’s picture

Status: Postponed (maintainer needs more info) » Fixed

sorry....it's just to change the block_type: $view->block_type = 'list';

marked it as fixed

Anonymous’s picture

Status: Fixed » Closed (fixed)

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