How to install and setup user relationships

The user relationship module can be used to create relationships between users on your drupal site. In this example we’ll be creating a single relationship called “Friends”. Requirements:

  1. Drupal 6
  2. User relationship module (
  3. Views module ( If you want to integrate with views.

1 Install the module

Go to and download the module and place it in sites/all/modules folder.

Then enable the required modules at Administer >> Site building >> Modules.

Make sure you enable the following modules:

  1. UR-API, this module is required.
  2. UR-Mailer, used to send friend request and approval emails.
  3. UR-UI, creates screens for users to manage relationships.
  4. UR-Views, integrates the module with views.


2 Create a relationship type

Next let’s create a relationship type. To keep this tutorial simple let’s create a single relationship type called “Friend”.

Go to Administer >> User management >> Relationships and click on Add type.

Enter in the name friend and plural name friends. Keep requires approvalticked and tick the authenticated user check box in the role access. Then click on submit.


3 Setting up right permissions

The standard way of friending a user will be to go to their profile page (user/1) and click on a link on that page.

Go to Administer >> User management >> Permissions and set them up as the following:

  1. Tick access user profile under user module for anonymous user andauthenticated user.
  2. Tick can have relationships under user_relationships_api module forauthenticated user.
  3. Tick maintain own relationships under user_relationships_ui module forauthenticated user.
  4. Tick view user relationships under user_relationships_ui module forauthenticated user.
  5. Scroll to the bottom and click on Save permissions.


4 First test

Now we should test if we can become friends with other users, if you are logged on as admin go to another users profile page. You should see a Become name’s friend link.


If you are not seeing the link there could be 2 problems:

  1. Check that you have setup the right permissions.
  2. You have customised your themes user-profile.tpl.php file.

5 Setting up emails

Now let’s setup the friend request and approval emails. Go to Administer >> User management >> Relationships >> Settings. Scroll down to the Email Options field set, all emails are selected to be sent by default.

Let’s be nice to our users and only have the request and approval email sent.


That’s it, now you should have a simple friends system on your drupal site using the user relationships module. If anyone has any problems please comment below.