Facebook Like 按钮可以设为只读吗?

发布于 2024-11-07 17:29:42 字数 377 浏览 3 评论 0原文

我在我的网站中使用 Facebook Likes。我有一个图库页面,显示图片/视频数据以及该数据的喜欢数量。每条数据都有自己的URL,可以点赞。

但是,我想在图库导航中显示喜欢的数量,但我不希望人们能够从导航中“喜欢”。有没有一种方法可以在没有按钮的情况下显示点赞数?

到目前为止,我看到的唯一方法是使用 FQL 中的链接统计“表”: http://developers.facebook.com/docs/reference/fql/link_stat/

有没有更简单的方法,因为这似乎需要大量的工作来实现。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想挽留 2024-11-14 17:29:42

您可以:

1)自己通过facebook图表收集喜欢的数量,将它们保存在DB中,然后在没有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": "Personal blog",
   "likes": 15,
   "website": "http://www.huffingtonpost.com/",
   "description": "Breaking News and Opinion"
}

因此 "likes": 15,

对于某些资源,您将需要访问令牌如有必要,请对您的网址进行 url 编码,因为这可能会导致复杂网址出现问题。

2)在iframe版本中显示点赞按钮,并在顶部放置另一个div,这样用户就无法与其交互,但我不建议这样做,因为当用户尝试点赞时,这可能会让他感到沮丧。 (用户已经习惯了他们可以点击这个)

我想第三种选择是每次显示页面时也使用图形 API 在客户端上获取 JavaScript 中的 Like 数量

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文