Community Documentation

2. Buddy API

Last updated February 2, 2008. Created by nodestroy on February 2, 2008.
Log in to edit this page.

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.

About this page

Drupal version
Drupal 5.x

Site Building Guide

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.
nobody click here