简体   繁体   English

我的网站上的Facebook评论

[英]Facebook Comments on my Site

I've added the Facebook social plug-in to my site, which allows users to comment using their facebook profile. 我已将Facebook社交插件添加到我的网站,该插件允许用户使用其Facebook个人资料发表评论。 However, I have more than 1 item on a page, and want users to make individual comments, because currently, when a user makes a comment on 1 item, it adds that comment to every item. 但是,我在页面上有多个项目,并希望用户发表单独的评论,因为当前,当用户对1个项目进行评论时,它会将该评论添加到每个项目中。 This is probably because each item is called onto the site using a while loop which echo's and prints every single item stored in my database. 这可能是因为每个项目都使用while循环调用到站点上,该循环回显并打印存储在数据库中的每个项目。 Does anyone know if there's a way around this or not? 有人知道这是否有办法吗? If it helps, the code facebook provides users with is as follows: 如果有帮助,facebook为用户提供的代码如下:

<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=109566779171141";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

and

<div class='fb-comments' data-href='My URL' data-width='470' data-num-posts='10'></div>

Thanks! 谢谢!

The only way to do this is to assign a unique URL per comment box, even if they are on the same page you are able to use something like: 唯一的方法是为每个注释框分配唯一的URL,即使它们位于同一页面上,您也可以使用类似以下内容的方法:

http://www.example.com/#comments1
http://www.example.com/#comments2
http://www.example.com/#comments3
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM