function _user_relationships_between in User Relationships 5
Same name and namespace in other branches
- 5.2 user_relationships.module \_user_relationships_between()
List of relationships between two users
1 call to _user_relationships_between()
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;
}