Closed (won't fix)
Project:
Buddylist2
Version:
6.x-1.x-dev
Component:
Buddy API
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Sep 2008 at 17:09 UTC
Updated:
6 Jan 2009 at 18:23 UTC
What's the status of the views2 integration? I tried to look in CVS to see if this was being worked on, but the buddylist_api.views.inc file appears to be empty. So I take it that means it's still very early stages?
I need to filter nodes based on if they were created by a friend of the current logged in user.
It took me several hours to get my head around what Views2 is doing with Handlers etc, but I worked out that adding this code to buddylist_api.views.inc and then clearing the views cache gives me the filter I require:
function buddylist_api_views_data() {
$data = array();
$data['buddylist_relations']['table']['group'] = t('Buddylist');
$data['buddylist_relations']['requester_id'] = array(
'title' => t('Your Buddy'),
'help' => t('A link if your buddy did create the node'),
'filter' => array(
'handler' => 'views_handler_filter_user_current',
),
);
$data['buddylist_relations']['table']['join']['node'] = array(
'left_field' => 'uid',
'field' => 'requestee_id',
);
return $data;
}
Is this useful for anyone? I'm going to have to keep developing this anyway - unless someone is working on a more complete views2 integration.
Comments
Comment #1
darrenmothersele commentedComment #2
crizthere will be no supported d6 version...