以下是我用于显示Facebook粉丝页面图片的代码。代码工作正常,但问题是它没有从所有相册中获取图像。它仅限于个人资料图片专辑。请告诉我如何修改以下代码,以便显示所有相册中的图像。
<?php
$facebook_album = file_get_contents(
"http://graph.facebook.com/194458563914948/photos?limit=50");
$dataArr = json_decode($facebook_album, true);
foreach($dataArr['data'] as $d){
echo "<img src=\"".$d['source']."\"><br />";
}
?>
答案 0 :(得分:3)
graph.facebook.com/PAGE_ID/albums
graph.facebook.com/ALBUM_ID?fields=photos.fields(source)
graph.facebook.com/PAGE_ID/albums?fields=photos.limit(100).fields(source)
{
"query1":"SELECT aid FROM album WHERE owner = PAGE_ID",
"query2":"SELECT pid, src_big FROM photo WHERE aid IN (SELECT aid FROM #query1)"
}
SELECT pid, src_big FROM photo WHERE aid
IN (SELECT aid FROM album WHERE owner=PAGE_ID)