2. Buddy API
Last modified: February 2, 2008 - 17:36
Buddy API provides basic functions to build a social network between users on your drupal site. Following a little overview of stuff what is done by buddy API.
- buddy_api_add() - adds a buddyconnection
- [buddy_api_add_oneway() - adds a buddyconnection]
- [buddy_api_add_request() - adds a buddyrequest]
- buddy_api_cancel_request() - cancels a buddyrequest
- buddy_api_deny_request() - denys a buddyrequest
- buddy_api_accept_request() - accepts a buddyrequest
- buddy_api_get_buddies() - returns an array with all buddies of the given user
- buddy_api_get_requestees() - returns an array with users, which requested to add the given user
- intern functions -> please look at the code
oneway vs. twoway
You can use buddy API in two different ways. Oneway connections are like bookmarks: That means, if userA adds userB to his buddylist, userB will not be notified of that action (and userA will be on userB´s buddylist). Twoway connections are like real friends: userA requests to add userB. UserB can accept or decline this accept. When he accept the request userA will be a buddy of userB and userB will be a buddy of userA.
