$user
인스턴스를 가져옵니다.
$user = $facebook->getUser();
로그인 한 사용자가 인증되었는지 확인하십시오.
if ($user) {
try {
// Proceed
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
게시에 필요한 권한이있는 로그인 URL을 제공하십시오. 사진 문서 http://developers.facebook.com/docs/reference/api/user/#photos
if ($user) {
$logoutUrl = $facebook->getLogoutUrl();
} else {
$loginUrl = $facebook->getLoginUrl(array(
'scope' => 'read_stream,publish_stream,user_photos'
));
}
장소 try/catch 블록에서 me/photos
호출이 발생할 수있는 예외를 포착하기에 명시된 바와 같이 특히 publish_stream
허가.
try {
$facebook->setFileUploadSupport('http://yourapicallingwebsite.com/');
$response = $facebook->api(
'/me/photos/',
'post',
array(
'message' => 'Testing the Photo Upload',
'source' => '@/path/to/img',
'place' => 'place_id'
)
);
}
catch (FacebookApiException $e) {
error_log('An error occurred posting the image');
}
확인 나로부터의 응답은/사진 만약 당신이 좋아하면, 그것은 당신 같은
<img src=<?php echo $photo_u['picture'] ?>/>
장소의 이름을 확인하는 경우
$photo_u = $facebook->api('/'.$response['id']);
디스플레이 전화
$photo_place = $photo_u['place'];
<span><?php echo $photo_place['name'] ?></span>
YOU ROCK !!!!!!! –