Remove comments from a comment box as an admin
I have a facebook application in which I generate pages for each object:
www.mydomain.com/object.php?object_id=1 --> apps.facebook.com/myapp/obejct.php?object_id=1
In each one 开发者_如何学运维of the pages I generate a comment box with the following code:
<div id="comment_box">
<div id="fb-root"></div>
<script>(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));</script>
<fb:comments href="http://www.mydomain.com/object.php?object_id=1" num_posts="10" width="380"></fb:comments>
</div>
The comments box shows properly for each object.
I also put myself as an admin in the headers of the page (inside the body tag):<meta property="fb:admins" content="MY_FACEBOOK_ID"/>
<meta property="fb:app_id" content="MY_APP_ID"/>
When a users comments inside the comment box, it shows the comment. If I want to delete it, it won't let me. It will only let me "report as abuse" or "spam"
Does anyone know how can I remove the comments?
Try this: http://developers.facebook.com/tools/comments
This will help in Moderate your comments.
I found this question via Google after running into this problem with a comment box created using the Drupal "Facebook Social Plugins" module. After trying to figure out where the moderate drop down had gone on the test comment I left and that of another administrator, I realized that it wasn't showing up for me because both the commenters were administrators for the app, so Facebook assumed we didn't need to moderate admins comments.
Once a non-admin left a comment, the moderate drop down gave us the option to delete the comment as normal.
use app id like this :
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=**325169277567924**";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
精彩评论