如果用户登录Facebook,是否可以检查php? [英] Is it possibile to check within php if a user is logged in facebook?

查看:136
本文介绍了如果用户登录Facebook,是否可以检查php?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想借此机会向我的网站用户发表评论。为了使东西更容易,我想给他们的opportuinity用他们的Facebook帐户登录。

I would like to give the opportunity to post a comment to my website user. To make stuff easier I want give them the opportuinity to login with their facebook account.

但我不知道如何检查他们是否登录在我的php?

But I don't get how Can i check if they are logged within my php?

注意:我不想使用他们的评论插件。

一个示例代码是:

<?php

   $fb = new Facebook();
   if ($fb->user->isLogged()) {
     //> Insert the comment in my database
   }

?>

感谢

推荐答案

如果您只需要为SEO提供评论,那么Facebook将有一个关于这个此处

同样在评论插件常见问题部分,有一个关于这个问题/答案:

Also in the comment plugin FAQ section, there is a a question/answer about this:


如何从留言留在我的网站?

Facebook的评论栏是以
的形式呈现在您的网页上的一个iframe,大多数
的搜索引擎将不会抓取内容
在一个iframe中但是,您可以
通过图形API访问
网站上留下的所有评论,如上所述
。只需从
的API中获取评论,并将它们放在
的正文中,您的页面位于评论框后面。我们
推荐您缓存结果,如
从图形中提取注释
每个页面加载的API可能会减慢
页面的呈现时间。

How can I get an SEO boost from the comments left on my site?
The Facebook comments box is rendered in an iframe on your page, and most search engines will not crawl content within an iframe. However, you can access all the comments left on your site via the graph API as described above. Simply grab the comments from the API and render them in the body of your page behind the comments box. We recommend you cache the results, as pulling the comments from the graph API on each page load could slow down the rendering time of the page.

这篇关于如果用户登录Facebook,是否可以检查php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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