Facebook 页面的 Facebook Like 按钮弹出网关

发布于 2024-12-14 01:54:36 字数 309 浏览 5 评论 0 原文

我想知道他们如何在 facebook 上创建带有“点赞”按钮作为进入和浏览页面的网关的页面...

这是一个示例... http://www.facebook.com/Diesel?sk=app_168523776552050

我知道如何在 iframe 中创建页面并放入 Facebook,但我不知道他们如何显示此弹出窗口以及如何向非粉丝访问者显示它。

请用你的想法和作品启发我......

I was wondering how do they create the page on facebook with like button as a gateway to enter and browse through the page...

Here is the one example....
http://www.facebook.com/Diesel?sk=app_168523776552050

I know how to create page in iframe and put in in facebook but I dont know how they show this popup and how do they show it for non fan visitors.

Please enlighten me with your ideas and works.....

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

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

发布评论

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

评论(3

吃兔兔 2024-12-21 01:54:36

这是一个简单的“粉丝门”,在无粉丝版本上,他们通过页面的 url 显示正常的点赞按钮。

这里描述了自己构建扇形门的简单方法:http://www.chilipepperdesign.com/2011/02/15/reveal-fan-gate-like-gate-facebook-iframe-tab-tutorial-with-php

喜欢按钮:

<fb:like href="http://www.facebook.com/diesel" send="true" width="450"
show_faces="true"></fb:like>

This is a simple "Fan Gate", and on the none-fan version they show the normal like button via the url of the page.

A simple way to build a fan gate yourself is described here: http://www.chilipepperdesign.com/2011/02/15/reveal-fan-gate-like-gate-facebook-iframe-tab-tutorial-with-php

The like button:

<fb:like href="http://www.facebook.com/diesel" send="true" width="450"
show_faces="true"></fb:like>
勿忘心安 2024-12-21 01:54:36

试试这个:

  1. 验证您的应用程序并获取访问令牌
  2. 使用访问令牌来验证您的用户并从 FB 获取“签名请求”。
  3. '签名请求'会告诉你用户是否是粉丝

  4. 写一些代码: if (user is fan) { show为粉丝提供的内容}
    else { 为访问者显示内容 }

如果没有“签名的请求”,什么都不会发生。适用于 PHP 和 JS。

try this:

  1. authenticate your application and get an access token
  2. use access token to authenticate your user and to get a 'signed request' from FB.
  3. 'signed request' will tell you whether the user is fan or not

  4. write some code: if (user is fan) { show content for fans }
    else { show content for visitors }

Nothing happens without the 'signed request'. Works in PHP and JS.

蓝海 2024-12-21 01:54:36

解析来自 Facebook 的“signed_request”参数。请参阅http://developers.facebook.com/docs/howtos/login/signed -request/

每个签名的请求都包含一个“page”键和一个“liked”子键,其值为布尔值,表示该页面是否已被喜欢。

根据该布尔值显示横幅。

请注意,只有页面选项卡视图上有类似按钮。 Canvas 应用程序周围没有“赞”按钮。

Parse the 'signed_request' parameter from Facebook. See http://developers.facebook.com/docs/howtos/login/signed-request/

Each signed request contains a 'page' key with a 'liked' subkey whose value is a bool of whether the page has been liked.

Display the banner depending on the value of that bool.

Note that only the Page Tab view has a like button on it. The Canvas App does not have a like button surrounding it.

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