我想获取标记了我的特定朋友照片,以及标记了同一位朋友的照片。我正在使用 fql,类似这样的东西,其中 $_POST[friend_id] 以前是从带有我所有列出的朋友:
$facebook_login = "0";
$user = $facebook->getUser();
$perms = array('scope' => 'email,user_photos,read_mailbox');
if ($user) {
try {
$user_profile = $facebook->api('/me');
$facebook_login = "1";
} catch (FacebookApiException $e) {
$user = null;
}
} else {
die('<script>top.location.href="'.$facebook->getLoginUrl($perms).'";</script>');
}
//friend photos that I'm tagged in
$query = "SELECT id FROM photo WHERE from = $_POST[friend_id] AND tags IN ($user)";
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => $query,
));
echo sprintf('<pre>%s</pre>', print_r($result,TRUE));
//my photos with my friend tagged in
$query = "SELECT id FROM photo WHERE from = $user AND tags IN ($_POST[friend_id])";
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => $query,
));
echo sprintf('<pre>%s</pre>', print_r($result,TRUE));
我可以这样做吗?
谢谢