Buddylist 2 Current user pictures
mariusooms - March 4, 2008 - 06:24
| Project: | Buddylist2 |
| Version: | 5.x-1.x-dev |
| Component: | Buddy API |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.

#1
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.
<?php$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;
?>
#2
I'm marking this fixed
#3
Automatically closed -- issue fixed for two weeks with no activity.
#4
Thanks
#5
i get a black point at the left bottom side of the picture...how can i get rid of it?
#6
maybe you can post your source code for this section of your page
#7
i just imported the code above to views without
<?phpat the beginning and
?>
after enabling the block i get the attached result >>> buddies.jpg.
(thanks for the great module, dominik!!!)
#8
sorry....it's just to change the block_type: $view->block_type = 'list';
marked it as fixed
#9
Automatically closed -- issue fixed for two weeks with no activity.