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