이 코드는 내가 가지고 올 코드입니다. 액세스 토큰이 있다면 누군가에게 정식 이름을 입력하고 프로필 이미지를 가져옵니다.
<?php $fullname= get_the_title(); //gets users name
$data = file_get_contents('https://graph.facebook.com/search?q='.urlencode($fullname).'&type=user&access_token=...'); //Querys FB ID from facebook graph api
$lessdata = substr($data, strpos($data,'id":"') + 5); //Removes evrything before the start of the FB ID
$fbid = substr($lessdata, 0, strpos($lessdata, '"')); // removes everything after the FB ID
$fbimage = 'https://graph.facebook.com/'.$fbid.'/picture'; echo '<img src="'.$fbimage.'"/>' ?>
도움이 되겠지만 최상위 검색 결과의 프로필 이미지를 얻으려면 어떻게해야합니까? – Steven
http://graph.facebook.com/4/picture 또는 ID가 무엇이든간에. – bkaid
그러나 haw 나는 PHP 코드에서 직접이 작업을 수행 할 수 있습니다. 수동으로 사용자 ID를 전송하지 않아도됩니다. 응답 btw 주셔서 감사합니다. – Steven