2
我正在尝试使用下面的代码添加Facebook评论社交插件的版主。看起来无论我输入什么Facebook用户ID,唯一可以调节的用户是被设置为应用管理员(在Facebook端)的用户。任何人都可以提出我可能做错了什么。无法为Facebook评论设置版主社交插件
<!DOCTYPE html>
<html xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<meta property="fb:admins" content="xxxxxxxxxxxxxxxx"/>
<meta property="fb:moderator" content="xxxxxxxxxxxxxxxxxx"/>
<meta property="fb:app_id" content="xxxxxxxxxxxxxxxxxxx"/>
</head>
<body>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js#appId=xxxxxxxxxxxxx&xfbml=1"></script>
<fb:comments href="" numposts="10" width="480" colorscheme="dark" migrated=1> </fb:comments>
</div>
<div id="user-info"></div>
<p>
<button id="fb-auth">
Login
</button>
</p>
<script>
//Facebook
window.fbAsyncInit = function() {
FB.init({
appId: 'xxxxxxxxxxxxxxxxxx',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
function updateButton(response) {
var button = document.getElementById('fb-auth');
if (response.authResponse) {
//user is already logged in and connected
var userInfo = document.getElementById('user-info');
var actionInfo = document.getElementById('action-info');
FB.api('/me', function(response) {
userInfo.innerHTML = '<img src="https://graph.facebook.com/' + response.id + '/picture">' + response.name;
button.innerHTML = 'Logout';
});
button.onclick = function() {
FB.logout(function(response) {
var userInfo = document.getElementById('user-info');
userInfo.innerHTML="";
});
};
} else {
//user is not connected to your app or logged out
button.innerHTML = 'Login';
button.onclick = function() {
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
var userInfo = document.getElementById('user-info');
userInfo.innerHTML = '<img src="https://graph.facebook.com/' + response.id + '/picture" style="margin-right:5px"/>' + response.name;
});
} else {
//user cancelled login or did not grant authorization
}
}
,{scope:'email'}
);
}
}
}
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
</body>
</html>
我希望你能得到一个答案,我我也一直在努力。 – DMCS 2012-01-30 00:18:08
看起来很多人都有。如果你想出来,请发帖,我会一样。 – 2012-01-30 01:42:20
难道你不能通过实际的评论小部件来做到这一点吗?我相信它在上下文菜单之一中。 – skarz 2014-05-12 01:35:04