Facebook喜欢按钮,它可以只读吗? [英] Facebook Like button, can it be made read only?

查看:107
本文介绍了Facebook喜欢按钮,它可以只读吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上使用Facebook喜欢我有一个画廊页面,显示图片/视频数据和该数据的喜欢数量。每个数据都有自己的URL可以被喜欢。



但是,我想在图库导航中显示喜欢的数量,但是我不想让人能够从导航中喜欢。有没有办法显示没有按钮的喜欢的数量?



到目前为止,我看到的唯一方法是使用FQL中的link stattable a href =http://developers.facebook.com/docs/reference/fql/link_stat/ =nofollow> http://developers.facebook.com/docs/reference/fql/link_stat/



是否有一种更简单的方法,因为这似乎是相当多的工作来实现。

解决方案

您可以:



1)自己通过Facebook图形收集喜欢的数量,将其保存在数据库中,然后将其显示在自己没有FB。



示例: http ://graph.facebook.com/http://www.huffingtonpost.com/



或者更好: http://graph.facebook.com/http%3A%2F%2Fwww.huffingtonpost.com%2F



哪些返回:

  {
id:141265189223470,
name:The Huffington Post - Breaking News and Opinion,
picture:http://profile.ak.fbcdn.net/hprofile- ak-snc4 / 188056_141265189223470_1131566_s.jpg,
link:http://www.huffingtonpost.com/,
category:个人博客,
喜欢 :15,
网站:http://www.huffingtonpost.com/,
描述:最新消息和意见
}

因此喜欢:15,



对于某些资源,您将需要访问令牌和URL编码你的url,如果有必要,因为它可能会导致复杂的URL的问题。



2)显示iframe版本中的相似按钮,并放置另一个div,以便用户不能与它进行交互,但是我不会建议,因为它可能会让用户在尝试时感到沮丧。 (用户习惯了他们可以点击这个事实)



我猜第三个选项是每次你在客户端上获取像Javascript一样的数量使用图表api


显示页面

I'm using Facebook Likes in my site. I have a gallery page which shows picture/video data and the number of likes for that data. Each piece of data has it's own URL which can be liked.

However, I want to display the number of likes in the gallery navigation, but I don't want people to be able to "like" from the navigation. Is there a way to display the number of likes without the button?

The only way I've seen so far is using the link stat "table" from FQL: http://developers.facebook.com/docs/reference/fql/link_stat/

Is there an easier way because this seems like a fair amount of work to implement.

解决方案

You can :

1) collect the number of likes through the facebook graph yourself, save them in a DB and then display it on your own without FB.

Example : http://graph.facebook.com/http://www.huffingtonpost.com/

Or better : http://graph.facebook.com/http%3A%2F%2Fwww.huffingtonpost.com%2F

Which returns :

{
   "id": "141265189223470",
   "name": "The Huffington Post - Breaking News and Opinion",
   "picture": "http://profile.ak.fbcdn.net/hprofile-ak-snc4/188056_141265189223470_1131566_s.jpg",
   "link": "http://www.huffingtonpost.com/",
   "category": "Personal blog",
   "likes": 15,
   "website": "http://www.huffingtonpost.com/",
   "description": "Breaking News and Opinion"
}

And thus "likes": 15,

For some ressources you will need an access token and url encode your url if necessary, as it could lead to problems with complex urls.

2) Display the like button in iframe version and put another div on top so that user cannot interact with it, but I wouldn't recommend that as It might frustrate your user when he will try to like. (Users are accustomed to the fact that they can click on this)

I guess a third option would be to fetch the number of like in Javascript on the client each time your display the page also using the graph api

这篇关于Facebook喜欢按钮,它可以只读吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆