8

I have installed the User Relationships module, and I have questions about how it works.

When you install the module, a "relationships" link should be added in a user profile page (users/myname), but in my case it doesn't; I've modified user-profile.tpl.php, and cleared the cache, but still the link doesn't appear. What's wrong?

How can I add a link to "add/remove friend" on a content-profile node of user? And also how to output list of user's friends? I guess a view block would help me in this situation.

  • Can you see the links as the admin account? Are there any configuration options that need to be set first? Have you looked into your permissions? It may be that users need to be assigned permissions before they can view the links. – Jamie Hollern Jun 6 '11 at 16:05
  • 1. i Can't see the links as the admin. 2. No 3. Yes, granted permissions to all users. – Alexander Kim Jun 6 '11 at 18:22
  • Could you possibly post a link to the site? – Jamie Hollern Jun 7 '11 at 14:44
  • here: ruh.kz – Alexander Kim Jun 7 '11 at 14:59
  • 1
    What version of Drupal? Which version of User Relationships? – John Fiala Jun 16 '11 at 21:55
9
+50

I followed the instructions that I found in the documentation of the module, and everything worked absolutely perfect. The steps for your reference were:

  1. Enabled the modules: UR-API, UR-Mailer, UR-UI, UR-Views
  2. Created a new relationship (e.g. friend)
  3. In Permissions make sure that you have enabled the can have relationships permission in the user_relationships_api module (this is what I forgot the first time)

The rest of the permissions are pretty straight-forward. If you follow the instructions to the letter, you will get the link in the user profile page.

P.S: The guide in the above-mentioned link has a screenshot for the required permissions: make sure that your permissions match this screenshot's EXACTLY.

As for the block that you want to create:

Enable the UR-blocks module. It creates sample useful blocks (including a block for each relationship that you created). You can insert this block directly in the profile node using the corresponding tpl.php file and a code like the one that you can find in this article:

Drupal - How To Display Block In Node?

  • ok, 1st question is solved. Deleted modifies user-profile.tpl.php and cleared the cache, then link become a friend bla bla appeared on user-profile. I can easily print this link in a user-profile.tpl.php with this code: <br /> <?php print $profile['user_relationships_ui']; ?> <br /> Now is the 2nd question: <br /> How can i add a link to "add/remove friend" on a content-profile node of user? And also how to output list of user's friends? (I guess views block would help me in this situation). – Alexander Kim Jun 12 '11 at 15:24
  • Ok, now i've added the link add/remove friend in a profile node. Posted my solution here: webcoder.kz/… So now is the only one question remains: How to output a block of user friends in a user profile with views? – Alexander Kim Jun 12 '11 at 16:09
  • Are you using the advanced profile kit? Are you using panels? How do you get the user profile as a node (i.e. which module are you using to do that)? – F1234k Jun 12 '11 at 16:15
  • I'm not using nor APK, nor panels. I'm using content_profile module to do that. – Alexander Kim Jun 12 '11 at 16:23
  • Check the additions in the edit above. – F1234k Jun 12 '11 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.