I've just added this snippet to my wordpress blog...
<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_GB/all.js#xfbml=1&appId=145875562182317";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
With the code below on my single.php template.
<div class="fb-comments" data-href="<?php the_permalink() ?>" data-num-posts="10" data-width="642"></div>
Source taken from facebook developers site...
http://developers.facebook.com/docs/reference/plugins/comments/
This has added a sweet facebook comments box onto my blog posts. But I need to moderate the comments some how?
So I've read the documentation and it says add this meta into your head with my user ID.
<meta property="fb:admins" content="6468594984"/>
This seemed to work, only if I went to that post when I was logged in as facebook user 6468594984 - and I could see a moderator view button on the comments box. So this worked.
How ever this is slightly impractical.. so I went to the next level.
I created a facebook app with the correct site URL on the website tab ending with... /
Changed my previous meta for this...
<meta property="fb:app_id" content="766484684648"/>
and I presumed by going to...
http://developers.facebook.com/tools/comments
...that I could now moderate all the comments for my wordpress site by viewing app 766484684648.
But no comments are appearing on app id 766484684648 within the tools comments site.
Can any one help enlighten me on where I've gone wrong or where I need to fix.
Thanks hugely!!!
After you changed your meta tag, did you run your URL through the URL Linter? Perhaps Facebook just had not detected the change you made to the meta tag, due to caching.
Try pasting the URL you use for the comments module into http://developers.facebook.com/tools/debug and verify that there are no errors, and that the app id is coming through.
Related
I am trying to add comments to my Website.
I have followed basic instructions at https://developers.facebook.com/docs/plugins/comments/ and comments box appears..
I want to enable Moderation, so followed instructions at https://developers.facebook.com/docs/plugins/comments/#moderation-setup-instructions but I am not able to get the moderation tool to work.. I expect to see comments appearing at https://developers.facebook.com/tools/comments/ or see the moderation link on each page with comments, but neither are happening..
I have included the fb:app_id and og:url and have no issues when viewing on https://developers.facebook.com/tools/debug/sharing and tried including the fb:admins (but the guide above suggests i should not include both)
I've been searching for answer for 2 days. In my case problem was with data-url attribute. I have publications in multiple languages and I set data-url value without language info, so that comments in other languages be seen in each language. But as I see now facebook does not allow that kind of data-url value. I set that value same as exact url in browser and everything works, also I will suggest adding og:url value same as exact url.
Hope this will help somebody!
You just need to add og alternate languages meta tag like below
<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="ka_GE" />
First is the current language (example: domain.com/en/item/1)
Second is the alternate language url (example: domain.com/ka/item/1)
How it worked for me...
1º Step - Find your user ID:
On Facebook Interface:
Click in the top right of Facebook.
Select Settings & Privacy, then click Settings.
Click Apps and Websites in the left menu.
Click View and edit next to an app or game.
Scroll down to Learn more. Your user ID is in the paragraph below.
Facebook doc about that: https://www.facebook.com/help/1397933243846983
2º Step - Find your APP ID or create one here:
https://developers.facebook.com/tools/comments/
3º Step - Add these tags inside HEAD of your page (NEEDS TO BE IN HEAD ONLY):
<meta property="fb:admins" content="[YOU FACEBOOK USER ID]"/>
<meta property="fb:app_id" content="[YOUR APP ID]" />
4º Step - Set this script where you want to show the comment box:
<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/pt_BR/all.js#xfbml=1&appId=[YOUR APP ID]";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="[URL OF YOUR PAGE]" data-num-posts="5" data-width="815" data-colorscheme="light" data-mobile="false" data-order-by="reverse_time"></div>
I have on my webpage the code for comments 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=111285118965654";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:comments href="MY_WEB_URL" num_posts="2" width="470"></fb:comments>
Comments works fine. I've already have on the head:
<meta property="fb:admins" content="MY_FBID"/>
<meta property="fb:app_id" content="MY_APPID"/>
With these options, i have moderation tool working, but i can't delete any post from users. I've read (i don't know if it's true) that if someone login to facebook with my application, and adding on FB.login a scope with parameter "publish_stream", then, my application will have a way to delete any comment. Well, the problem is that i don't know how to force a user to login to my facebook app before making a comment.
Sorry if my explanation is not good or is wrong.
Thanks
You can check to see if user is logged in and has given permission, if so render comment box if not then render a login button for user to reAuth or Auth with your app.
Let me find a few code snippets.
NOTE: I just tested this with my app using https://developers.facebook.com/tools/comments i was unable to delete any post but my own, or my pages own. Other users are still hide, ban or boast.
Right now i am using facebok comment box and i have made my self as moderator for this comment box.
<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=288593874528383";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
I have specified my admin in meta tag
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>
What is the way to delete any comments given by any user on facebook commentbox?
http://developers.facebook.com/docs/reference/plugins/comments/
Specify fb:app_id as meta property in head of the html doc, like:
<meta property="fb:app_id" content="123456"/>
and repalce 123456 with your app id. Than, if you are the admin of the fb app, you should be able to moderate the comments using this link: https://developers.facebook.com/tools/comments
You can use the graph API to delete comments. Does that help?
Moderation Setup
To use the moderation tool, you either need to connect a Facebook account or a Facebook app to your Comments plugin implementation.
Setup using a Facebook Account
Simply include the following meta tag in the section of every document in which you use the comments plugin:
A. <meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>
OR
Setup using a Facebook App
B. <meta property="fb:app_id" content="{YOUR_APP_ID}" />
Source: https://developers.facebook.com/docs/plugins/comments#moderation-setup-instructions
I have added a facebook comment social plug in box here: www.example.com/guestbook.html
I have included the following line of code on the page:
<meta property="fb:app_id" content="370981509585131"/>
I do have this SDK code at the top of the page:
<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=370981509585131";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
So I have the SDK with the AppID in there, and I added the code as instructed on this
page but I have not been able to moderate the comments from the comment moderation tool
Seems like you have wrong value for fb:admins OpenGraph meta tag:
Object at URL 'http://www.forumgoesmody.com/guestbook.html' of type 'website' is invalid because the given value '10100218701442679' for property 'fb:admins' could not be parsed as type 'fbid'.
Request to http://graph.facebook.com/10100218701442679 return false
You should fix the errors outlined in Object Debugger tool for URL of page your Comments Social Plugin located on. Once you fixed the errors you should be able to moderate your comments in Comments Moderation tool
You can simply remove fb:admins, if only Administrators of Application (fb:app_id) should be able to moderate the comments.
You could check my answer to similar probem at: https://stackoverflow.com/a/9073966/1134615. Not sure wether thats a proper solution but that works for me. Also, remove:
<meta property="fb:app_id" content="370981509585131"/>
as it is already stated in js.
I integrated FB comments on a static page. I can comment and see my comments, but I have problems with moderating comments in the moderation tool. There are no comments in the tool.
I have this code, which should help me to modearete:
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml">
<meta property="fb:admins" content="7675xxxxx" />
<meta property="fb:app_id" content="xxxxx5675551420" />
And in inside the body I have:
<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/de_DE/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="http://www.example.com/demo" data-num-posts="10" data-width="900"></div>
What is the problem here?
By the way, how can I set it up, that also NON-Facebook Users can comment? I want to
allow anonymous comments. I see no settings for that?
thx
Did you added your user account as moderator in http://developers.facebook.com/tools/comments?
If not, try to add your user account in your application as moderator. Then see is it working.
Please note moderation tool will be available only for non-admins's comments. You cannot moderate your (or other admins') comments.
Edit: Moderators can moderate only 'normal' users comments. Try commenting from a FB account which is not in the comment moderators list.