A photo tag as represented in FQL.
The Photo object has an equivalent tags connection.
Note: Both object_id and pid uniquely identify a photo, and object_id is the preferred column to use.
To read the photo_tag table you need the following permissions:
User:
user_photos permissions to access photo tag information that a user is tagged in.friends_photos permissions to access photo tag information that a friend is tagged in.Group:
access_token to access photo tags of a public group.user_photos permissions to access photo tags of a user for a non-public group that the current user is a member of.friends_photos permissions to access photo tags of a friend for a non-public group that the current user is a member of.Event:
access_token to access photo tags of a public event.user_photos permissions to access photo tags of a user for a non-public event that the current user has been invited to. If the invited user removes the event from their list they will no longer be able to read the table.friends_photos permissions to access photo tags of a friend for a non-public event that the current user has been invited to. If the invited user removes the event from their list they will no longer be able to read the table.Note: You can also use the photo_tag FQL table to query for photos associated with a group (given its gid) or event (given its eid). See below for sample queries on how to do this.
| Indexable | Name | Type | Description |
|---|---|---|---|
| * | object_id | int | The object_id of the photo being queried. Preferred over pid. |
| * | pid | string | The ID of the photo being queried. The |
| * | subject | int | For tagged users, use the user ID of the subject for the tag being queried. For photos associated with events or groups, use the eid or gid for subject. |
| text | string | The content of the tag being queried. It contains either the name of the user tagged or the text tag. | |
| xcoord | float | The center of the tag's horizontal position, measured as a floating-point percentage from 0 to 100, from the left edge of the photo. | |
| ycoord | float | The center of the tag's vertical position, measured as a floating-point percentage from 0 to 100, from the top edge of the photo. | |
| created | time | The date that the tag being queried was created. |
Get all tags for a photo associated with a user, given a photo id (pid).
SELECT text FROM photo_tag WHERE pid ='$pid'
Get all pids of photos associated with a user, given its user id (uid).
SELECT pid FROM photo_tag WHERE subject=$uid
Get all pids of photos associated with an event, given its event id (eid).
SELECT pid FROM photo_tag WHERE subject=$eid
Get all pids of photos associated with a group, given its group id (gid).
SELECT pid FROM photo_tag WHERE subject=$gid