Facebook: How to add a Tag to a Fan page in the Caption of the Photo uploaded to users profile
I have seen a Fan page wall being tagge开发者_如何学JAVAd in a photos caption.
http://www.facebook.com/photo.php?fbid=165019486869988
Notice its in the Caption itself, and its a Fan page that was tagged, not a person.
How was this done? I actually cant even see how to do it manually on Facebook.
Can it be done in a Facebook PHP App? If so how?
So when my application posts to the users "Application Photo Album" the caption would have a link back to my apps fan page or app page.
This would all involve databases, and I have done something like this before. It is pretty involved the way facebook does it because they also link back to the tagged users page.
You would have to have a unique user ID for each user and a unique photo ID for each photo.
When a person pulls up the image the web site would query the MySQL Database and look for the record that matches the Photo ID, then it would look for the tagged User ID's that are attached to that Photo ID, which would be stored under that database record when the user was tagged.
The web site would then echo out the results of the database query to retrieve all of the tagged User ID's and you would have to then make the User ID's appear as the users name, which would require a function to take that User ID and query another database that will retrieve the users actual name and return it to the script.
The question you asked is very general and I can go on all day about the technicalities behind it, but I hope this gave you a general idea of how it can be done with PHP/MySQL.
Please let me know if you have any questions!!
I figured out that you can tag a fan page if you actually upload the image via your wall "Post Picture" then in the status message as your posting it you can tag the fan page @FanPage just like when you tag a friend in your status message.
Still not able to do this via programming.
Well i found a simpler solution to the same that uses the graph api
http://developers.facebook.com/docs/reference/api/photo/
You can specify which user to tag using two methods: in the URL path as PHOTO_ID/tags/USER_ID, or in a URL parameter as PHOTO_ID/tags?to=USER_ID. To add several tags at once, you can specify a tags property which contains an array of tags like so PHOTO_ID/tags?tags=[{"id":"1234"}, {"id":"12345"}]. Currently, you cannot tag a Page in a photo using this API.
Tagging a photo requires the user_photos and publish_stream permissions, publish_stream is optional - if not present, the tag will go through Tag Review of the tagged person if s/he has this privacy setting enabled. Tagging a photo supports the following parameters.
Hope this resolves the issue
精彩评论