Search code examples
phphtmlfacebookfacebook-comments

blog comments on facebook and on website's page on facebook


I'm writing a blog in php. I want facebook comments on every single blog entry. I also want those comments to appear on the website's page on facebook so people from the website and people on facebook which visited the website's page can comment on the same blog entry but from different places.

Here is what I want: When someone comments on a blog entry, the comment should appear on the website's page on facebook with, lets say the title of the blog entry and its picture. After that it should make no difference if you comment on the website or its page.

I have this in my code:

<div class="fb-comments" data-href="http://devbat.com/index.php?page=blog_view&amp;id=<?php echo $id; ?>" data-num-posts="2" data-width="690" data-colorscheme="dark"></div>

So facebook knows when there are different entries. The problem is, when I comment, the comment itself goes to my wall in facebook and not in the website's page on facebook.

I also have this script, as instructed on the facebook developers 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=193822290683618";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

I have seen websites that cross-post their comments on blog entries but I dont know how. Can someone PLEASE give me some help on the subject..

I know there are other questions here on StackOverflow but none of them seem to match my exact situation or the instructions given seem outdated or misleading.


Solution

  • There are now plug-in libraries/services, such as Disqus that take care of that.