如果存在,我想将图片发布到相册“Wall Photos”中,否则如果“Wall Photos”不存在,则发布没有相册的图像(APPNAME PHOTOS)。
$album = $facebook->api('/'PAGEID'/albums');
foreach($album['data'] as $album){
if($album['name'] == 'Wall Photos'){
$album_post = $album['id'];
}
}
$risultato['pagina'][$pagina['id']] = $facebook->api('/'.$album_post.'/photos', 'POST', array( 'access_token' => PAGETOKEN, 'source' => '@' . IMAGE, 'message' => TEXT ) );
if(!isset($album_post)){
$risultato['pagina'][$pagina['id']] = $facebook->api('/'.$pagina['id'].'/photos', 'POST', array(
'access_token' => $pagina['token'],
'source' => '@' . IMAGEPATH,
'message' => TEXT
)
);
}else{
$risultato['pagina'][$pagina['id']] = $facebook->api('/'.$album_post.'/photos', 'POST', array(
'access_token' => $pagina['token'],
'source' => '@' . realpath("../img_post/".$post['Immagine']),
'message' => $post['Testo']
)
);
}
但我收到该错误:第 1237 行的 base_facebook.php 中抛出的专辑 ID 无效