Facebook api php get friend photos where I'm tagged -
i want specific friend photos i'm tagged in, , photos same friend tagged in. i'm using fql, this, $_post[friend_id] passed form friends listed:
$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 i'm tagged in $query = "select id photo = $_post[friend_id] , tags in ($user)"; $result = $facebook->api(array( 'method' => 'fql.query', 'query' => $query, )); echo sprintf('<pre>%s</pre>', print_r($result,true)); //my photos friend tagged in $query = "select id photo = $user , tags in ($_post[friend_id])"; $result = $facebook->api(array( 'method' => 'fql.query', 'query' => $query, )); echo sprintf('<pre>%s</pre>', print_r($result,true));
can this?
thanks
try following queries:
to friend's photos you're tagged:
$friend_id = $_post['friend_id']; $query = "select object_id photo owner=$friend_id , object_id in (select object_id photo_tag subject=me())";
your photos friend tagged:
$query = "select object_id photo owner=me() , object_id in (select object_id photo_tag subject=$friend_id)";
Comments
Post a Comment