嗨首先抱歉我的英语。
我想要显示profil照片,所以我这样做:
<?php
try {
$fql = "select cover_object_id from album where type='profile' and owner = $user";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
}
catch (FacebookApiException $e) {
error_log($e);
}
$coverpid=$fqlResult[0]['cover_object_id'];
try {
$fql = "select src_big from photo where object_id=$coverpid";
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$fqlResult = $facebook->api($param);
}
catch (FacebookApiException $e) {
error_log($e);
}
$url_photo=$fqlResult[0]['src_big'];
echo '<img src="' . $url_photo . '">';
$bdd->exec("UPDATE user SET url_photo = '$url_photo' WHERE user_id = '$user'");
?>
我可以显示照片,然后再次显示照片并减少api请求编号,我在我的数据库中记录照片的网址。但问题是:网址给我一个无效的请求。
如何进行?我想我需要在网址中添加一个访问令牌,但我不知道如何获得...
你能帮帮我吗?非常感谢。PS:我有user_photos权限