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

mariusooms - March 4, 2008 - 17:59

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

mariusooms - March 4, 2008 - 18:00
Status:active» fixed

I'm marking this fixed

#3

Anonymous (not verified) - March 18, 2008 - 18:01
Status:fixed» closed

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

#4

jdev - April 13, 2008 - 09:27

Thanks

#5

telefunken - September 3, 2008 - 11:40

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

AttachmentSize
buddies.jpg4.76 KB

#6

nodestroy - September 3, 2008 - 11:45
Status:closed» active (needs more info)

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

#7

telefunken - September 3, 2008 - 12:24

i just imported the code above to views without

<?php
  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!!!)

#8

telefunken - September 3, 2008 - 13:58
Status:active (needs more info)» fixed

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

marked it as fixed

#9

Anonymous (not verified) - September 17, 2008 - 14:02
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.