Community Documentation

User Relationships

Last updated May 17, 2012. Created by RWWood on December 23, 2007.
Edited by kshama_deshmukh, mrf, RKS, LeeHunter. Log in to edit this page.

The User Relationships module allows users to create named relationships between each other.

Relationship Types

Relationship types are defined by an administrator at: Administer > User Management > Relationships (for D7: admin/config/people/relationships).

Relationship types have a name, a plural name, a time-out, an auto approve designation and a directionality. The name can be anything. The time-out is the amount of time a request stays active. For example, if it's set to 30 days and a user requests a relationship with another user and that user doesn't accept or deny the request within 30 days the request will be dropped.

If auto approve is set, the system skips the request->approve/deny process and simply creates the relationship. An application of this might be the relationship type "subscriber." You don't necessarily need to approve of me subscribing to you.

Directionality

two-way

An example of a two-way relationship may be "friends." If you're my friend I'm your friend. This is the default for new relationships created with User Relationships.

one-way

One-way relationships may be something like "manager", "teacher", "follower" or "stalker". You may be my manager, but I can not be your manager at the same time. By default when a one way relationship is created it cannot be reciprocated (like the manager example above).

If you would like the user to be able to create a second one-way relationship in the opposite direction (you follow me, I follow you back) then ensure that the "this relationship can be reciprocated" checkbox is checked.

Workflow

A user can request a relationship by visiting another user's profile and clicking the request relationship link. They can view a list of all their relationships, specific types of relationships or their pending relationship requests by visiting their own profile. Within "pending relationships" they can approve, deny or cancel a request (approve or deny if requested by another user, cancel if their request of another user).

Developers

Developers (both module and theme) are given a wide array of API functions with which they can build additional functionality.

Themers

Theme developers should look at user_relationships_theme.inc for all the theme functions that are used throughout the core module. Anything created by plugin modules will be discussed in their relevant section.

External Resources

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x
Level
Beginner, Intermediate
Audience
Contributors, Designers/themers, Programmers, Site administrators, Site builders, Site users
Keywords
Create user relationships, one-way relationship, two-way relationship

Site Building Guide

Drupal’s online documentation is © 2000-2013 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. Comments on documentation pages are used to improve content and then deleted.