You are here

function _user_relationships_between in User Relationships 5

Same name and namespace in other branches
  1. 5.2 user_relationships.module \_user_relationships_between()

List of relationships between two users

1 call to _user_relationships_between()
user_relationships_user in ./user_relationships_hooks.inc
User

File

./user_relationships.module, line 78

Code

function _user_relationships_between(&$viewer, &$viewed) {
  $list = array();
  $viewer_relationships = user_relationships_load_all_for_user($viewer->uid);
  foreach ($viewer_relationships as $relationship) {
    $related = $relationship->requestee_id == $viewed->uid || ($relationship->is_oneway ? FALSE : $relationship->requester_id == $viewed->uid);
    if ($relationship->approved && $related) {
      $list[] = t('%relationship_name (!remove_link)', array(
        '%relationship_name' => $relationship->name,
        '!remove_link' => theme('user_relationships_remove_link', $viewed->uid, $relationship),
      ));
    }
  }
  return $list;
}