How to build a block view that shows comon friends (related users) between the profile page that is seen and the logged user?
thanks for your work
How to build a block view that shows comon friends (related users) between the profile page that is seen and the logged user?
thanks for your work
Comments
Comment #1
dawehnerWhats your definition of related users?
This could be everything.
Comment #2
mortenson commentedOn User Relationships module, I have build a relationship calles "friend".
For example:
User A is friend of F, G, H
User B is friend of F, G, K
So, if user A visits the profile of user B, the "common friends" bock should display users F and G. The same as facebook common friends.
Hope is clear now,
Comment #3
dawehnerI think this is not a question for VIews. Its a specific question for User Relationships.
See http://drupal.org/node/239162 . I think this is a similar issue
Comment #4
mortenson commentedThat post is for building a "people you might know" block, it is different.
A common friends user is much simple.
Views has the potential of building this block.
Comment #5
likewhoa commentedsubscribing
Comment #6
dc1258 commentedI am going to pay for the development of a block/module which will allow mutual friends to be shown. Would anyone be interested in sharing the cost with me?
I also am going to pay for a friend of a friend (people you might know) feature to be developed.
Please let me know if you're interested!
Comment #7
okday commentedsubscribing
Comment #8
nonom commentedsubscribing
Comment #9
Chachrist Srisuwanrat commented//This is what i used. I hope it helps.
//arg(2) is the name of viewed profile
function ur_common_friends_block($op='list', $delta=0, $edit=array()){
switch ($op) {
case 'list':
$blocks[0]['info'] = t('Common friends');
return $blocks;
case 'view':
$blocks['subject'] = t('Common Friends');
$blocks['content'] = _get_common_friends();
return $blocks;
}
}
function _get_common_friends(){
$output = '';
global $user;
$account = user_load(arg(2));
$result = db_query("SELECT requestee_id FROM user_relationships AS ur1
WHERE ur1.requester_id = %d AND (ur1.requestee_id IN
(SELECT ur2.requestee_id FROM user_relationships AS ur2
WHERE ur2.requester_id = %d)) ORDER BY RAND()", $user->uid, $account->uid);
while($common_friend = db_fetch_object($result)){
picture.'">';
$friend = user_load($common_friend->requestee_id);
$output .= '
}
return $output;
}
Comment #10
GolDRoger commentedwhere do you have putted this function?
thx
Comment #11
broncomania commentedcan u make a view of it?
Comment #12
mrf commentedClosed #692124: Adding a mutual friends block as a duplicate of this issue.
Comment #13
baff commentednow both issues are closed because of duplicate issue - One should be reopened :-)
Comment #14
mrf commentedThis one should still be open, looks active to me.
Comment #15
mrf commentedRealized this is indeed a duplicate as well, leaving #239162: feature: block for "people you might know" as the authoritative mutual friends / common friends / people you might know issue.