Community Documentation

Flag Friend

Last updated August 17, 2010. Created by sirkitree on March 22, 2009.
Log in to edit this page.

Initial introduction:

http://sirkitree.net/node/17

Status definitions:

(excerpt from http://drupal.org/node/366844#comment-1256322)
FLAG_FRIEND_FLAGGED means that two users are friends. There are now no flags and there is just the relationship stored in the flag_friends table. This means that we cannot use flag's 'unflag' functionality, but must use our own. This is why I created the 'unfriend' action. This simply means that when this status is returned, we have to use a different url in order to remove the relationship. You've used this one correctly.

FLAG_FRIEND_BOTH - As soon as this status is detected within hook_flag(), which is as soon as you've approved a friend, both flags are removed and the relationship is recorded into the flag_friend table, essentially changing the status to FLAG_FRIEND_FLAGGED.

FLAG_FRIEND_UNFLAGGED - no one in relationship you are checking is flagged or friended.

FLAG_FRIEND_PENDING is when you have flagged someone else. You are not flagged, but they are. So when you look at another user's profile and get this status you are still seeing a regular flag and should see something that allows you to 'unflag' the user, not 'unfriend' them; you will be using normal flag operations instead of our additional one.

FLAG_FRIEND_APPROVAL is the opposite of FLAG_FRIEND_PENDING. So here someone else has flagged you and you want to Approve that relationship.

Changing the default tab

Please see this issue #872212: Changing the text of the menu tab from 'Friends' to something else

Page status

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders, Site administrators

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.