I have this code right here, where the $friends
variable is an array with an output like this:
{
\"id\": \"1149862205\",
\"name\": \"name\",
Try this:
$return = '';
$friends = $facebook->api('/me/friends');
if (!empty($friends['data'])) {
$size = variable_get('facebook_graph_pic_size_nodes','square');
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
foreach ($friends['data'] as $data) {
$fbid = $data['id'];
$fbfriendlikes[$fbid]=$facebook->api('/'.$fbid.'/likes');
$fbname = $data['name'];
$path = $protocol . '://graph.facebook.com/' . $fbid . '/picture?type=' . $size;
$image = theme('image', array('path' => $path, 'alt' => $fbname));
$likes = false;
foreach($fbfriendlikes['data'] as $like) {
if($like['id'] == '184759054887922') { // maybe $like->id will have to be used instead...
$likes = true;
break;
}
}
if (!$likes) {
$return .= ''.$image.'';
$link = ''.$fbname.'';
$return .= ''.$link.'';
}
}
echo $return;
}