РЕШЕНО! Вывод ссылки добавить в друзья в кастомном профиле для модуля User Relationship
Год искал решение и кое как нашел доделал. Но он с косяками и кривое. Может кто-нибудь поможет довести до ума.
<?php
// check if friends code
$account = user_load(array('uid' => $node->uid));
$owner = $node->name;
$current_relationships = user_relationships_load(array('between' => array($user->uid, arg(1))), array('sort' => 'rtid'));
$rid = $current_relationships['1']['0']->rid;
//if users are friends and relationship has been approved
if ($relationships = user_relationships_load(array('between' => array($user->uid, $uid),'approved' => 1))) {
// set a value of friends to 1 to allow content to be displayed below.
$friends = 1;
if (
$relationships = user_relationships_load(array('between' => array($user->uid, $uid),'approved' => 0))) {
// set a value of friends to 1 to allow content to be displayed below.
$friends = 0;
} elseif(
$user->uid != $uid) {
print
"<a href=/user/" . $user->uid . "/relationships/" . $rid . "/remove?destination=user/$uid/ class=\"user_relationships_popup_link\">".t('Remove ' . $owner . ' as Friend')." </a>";
$friends = 1;
} else {
$friends = 0;
}
}
elseif (
$user->uid != $uid) {
$friends = 0;
?>