It sounds like you're looking to do this for your own profile system. If so, I'm assuming you (or a developer) can implement some code to do what you're looking for. Below is a very quick snippet based on the
Facebook API calls for getting a user's friends
.
$user = JFactory::getUser(); // Get current user
$userId = $user->get('id');
$facebookId = JFBConnect::usermap()->getProviderUserId($userId, 'facebook');
$friends = JFBCFactory::provider('facebook')->api('/' . $facebookId . '/friends');
foreach ($friends['data'] as $friend)
{
$friendJoomlaId = JFBCFactory::usermap()->getJoomlaUserId($friend['uid'], 'facebook') // See if a Joomla user exists for this Facebook id
if ($friendJoomlaId)
{
// Do whatever needs to be done with this user account
}
}That is all untested code, but looks right. Please feel free to implement as necessary within your profile extension and let us know if you run into issues.
Finally, please note that you'll need to add the 'user_friends' field into the 'Additional Permissions Request' box in the JFBConnect -> Configuration -> Facebook area to make sure you request that permission from your users. I'd recommend reading up on that permission in Facebook's Docs as well:
developers.facebook.com/docs/facebook-lo...ference-user_friends
I hope that helps,
Alex