안녕하세요. 내 새로운 Facebook 응용 프로그램에서 사용자 프로필 화면을로드하려고합니다. 문제는 단지 너무 오래 걸린다는 것입니다. 이것이 내가 그림을 얻기 위해 현재하고있는 것입니다. - 제가 이것을 빨리하기 위해 할 수있는 것이 있습니까? 실행에 ~ 10 초 이상 걸립니다.Facebook 그래프 api php 너무 느린 사진보기
라이트 박스를 사용 중이며 화면의 첫 번째 이미지를 클릭 한 후에로드하는 데 추가 사진이 실제로 필요합니다.하지만 그 방법은 확실하지 않습니다.
//First off we need to get some profile pics for the user:
$getuseralbumsurl = "https://graph.facebook.com/". $row['FB_ID'] ."?fields=albums&access_token="
. $access_token;
$getuseralbums = json_decode(file_get_contents($getuseralbumsurl));
$getuseralbums = $getuseralbums->albums;
foreach($getuseralbums->data as $album){//Getting profile pics for user.
if($album->type == "profile"){ //get profile picture album
$albumid = $album->id;
$photosurl = "https://graph.facebook.com/" . $albumid . "/photos?access_token=". $access_token ."&limit=3";
$profilephotos = json_decode(file_get_contents($photosurl));
$counter = 0;
foreach($profilephotos->data as $image){
if($counter == 3)//we only want 3 photos from the album.
break;
if($lowerbound == 0)
$photosurlarray['group1'][] = $image->source;
else if($lowerbound == 1)
$photosurlarray['group2'][] = $image->source;
else
$photosurlarray['group3'][] = $image->source;
$counter++;
}
break;//we don't need anymore albums.
}
고마워요!