简体   繁体   English

Facebook 评论 - 强制用户登录网站?

[英]Facebook Comments - Force user to login to site?

I was wondering if I can require a user to login to my site before they can comment using facebook comments?我想知道我是否可以要求用户先登录我的网站,然后才能使用 facebook 评论发表评论? Right now if a user views a page with facebook comments (because I have a public facing section) then they can comment even if they aren't logged into my site (because they are logged into facebook).现在,如果用户查看带有 facebook 评论的页面(因为我有一个面向公众的部分),那么即使他们没有登录我的网站(因为他们登录了 facebook),他们也可以发表评论。

Can I have a "View Only" mode for comments or something similar?我可以为评论或类似内容设置“仅查看”模式吗? If not then I have to take the comments off the public facing site which I really don't want to do.如果不是,那么我必须从面向公众的网站上删除我真的不想做的评论。

Thanks for any help!谢谢你的帮助!

JAck杰克

i guess this is not possible...我想这是不可能的......

but giving you some reference that you get the callback after facebook user posts comments.但给你一些参考,你在 facebook 用户发表评论后得到回调。

reference url: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/参考 url: https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

FB.Event.subscribe('comment.create', function(response) {
alert('The commentID of the comment is: ' + response.commentID);
});

Waiting for some other comments for this thread.等待这个线程的一些其他评论。

You can always hide the comments box until the user logs in. Just subscribe to the FB.Event.subscribe() 's auth.statusChange to monitor for when the user's status changes.您始终可以隐藏评论框,直到用户登录。只需订阅FB.Event.subscribe()auth.statusChange即可监视用户状态何时更改。 Also you will need to check their current login status during page load (see FB.getLoginStatus() ).您还需要在页面加载期间检查他们当前的登录状态(请参阅FB.getLoginStatus() )。 Then when you know they're logged in, show the comments box.然后,当您知道他们已登录时,显示评论框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM