Adding a REMOVE link to the buddylist
bjraines - February 12, 2008 - 21:02
| Project: | Buddylist2 |
| Version: | 5.x-1.0-beta2 |
| Component: | Buddylist UI |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I saw another module, relationships, that has a nice remove link on the actual friendslist so you dont have to visit the other persons profile.
is this a possible new feature?

#1
hi, this would be no problem. just theme the friendslist-view and add a new column with the delete link:
/buddy/delete/UIDalternatively somebody could provide a buddy delete views field...
#2
i've added both 'remove' and 'add' views fields, it's not too hard to do. i wonder if these will make it to the module?
#3
Hi,
That is of great interest to me.
Please would you be so kind to show the full code for 'friendslist-view and add a new column with the delete link: /buddy/delete/UID' ?
Would most appreciate your help and thank you.
Lilian
#4
this links are now included. the views field name is "Buddylist: Actionlink". On your buddylist it will show a delete link, on a userlist it will add a delete or an add link.
#5
Automatically closed -- issue fixed for two weeks with no activity.
#6
Hi,
Got it all beautifully work, but unfortunately the actionlink stays at 'Add to my buddylist' in the view buddy_api_buddylist.
Have cleared cache, uninstalled, re-installed, but still 'add to my buddylist' when the user is already a buddy.
Will this perhaps be corrected in the next version, or maybe a little fix please ..
Look forward to hearing from you.
Lilian
#7
Oops, was my mistake. I uninstalled Buddylist (not 2) and that obviously deleted some tables. All good now, and thanx!
#8
sorry, may be i'm stupid, but i don't get a add link....i just can invite people per mail...can someone give me advice
#9
@ telefunken
You have a add/remove link on the userpages (user/UID). But you can also list users with views and display an add/remove link in it. See http://drupal.org/node/220959#comment-947483.
#10
thanks chriz! but i don't get a link. i tried other themes and so on. maybe because i use domainaccess!? can you give me the code? i can simply try to create a block...! i also tried to add a field called buddylist:actionlink to a block. nothing happens!?
#11
#12
maybe i'm using the wrong version!? 5.x-1.x-dev or 5.x-1.0-beta2 is working?
#13
Should work both I think...
#14
using latest beta and actionlinks are not included. Is there a way to manually add them to a view (page)?
#15
yes, there is a buddylist:actionlink viewsfield. just add it to your buddylist view.
see this view for example:
$view = new stdClass();$view->name = 'buddy_api_my_buddylist';
$view->description = 'list of my buddies (for block use - shows everytime the buddies of the logged user)';
$view->access = array (
);
$view->view_args_php = '';
$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 = 'table';
$view->url = '';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->block = TRUE;
$view->block_title = 'My Buddylist';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'table';
$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 (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'users',
'field' => 'name',
'label' => '',
),
array (
'tablename' => 'baj_node_buddylist_users',
'field' => 'buddy_actionlink',
'label' => '',
'handler' => 'buddy_api_views_handler_action_link',
),
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'usernode',
),
),
array (
'tablename' => 'baj_node_buddylist_users',
'field' => 'currentid',
'operator' => '=',
'options' => '',
'value' => '***CURRENT_USER***',
),
);
$view->exposed_filter = array (
);
$view->requires = array(users, baj_node_buddylist_users, node);
$views[$view->name] = $view;