简体   繁体   English

如何在没有实际评论的情况下动态创建facebook评论textarea?

[英]How can I dynamically create only the facebook comments textarea without the actual comments?

I want to do the following: I want to integrate the facebook comments widget but I want to customize it. 我想做以下事情:我想整合facebook评论小部件,但我想自定义它。 What I want from that widget is only the textarea where the users write their comments, but not the comments. 我想要的那个小部件只是用户写评论的textarea,而不是评论。

What I'm trying to achieve is that whenever somebody writes a comment in the Comment textarea that comment is send to facebook and also to a script on my server. 我想要实现的是,只要有人在评论文本区域中写评论,评论就会发送到Facebook,也会发送到我服务器上的脚本。 I saw that this can be achieved by using events (FB.Event.subscribe('comments.add', )). 我看到这可以通过使用事件来实现(FB.Event.subscribe('comments.add',))。 What I need is to show the comments from my website, not from facebook. 我需要的是显示我的网站的评论,而不是来自Facebook。 I'll use similar style - links Like and Reply will be present. 我将使用类似的风格 - 链接喜欢和回复将出现。 What I need is when somebody clicks a reply on such a comment to generate the FB comments textarea. 我需要的是当有人点击对此类评论的回复以生成FB评论textarea时。 I looked through their docs but I did not see a way to do it. 我查看了他们的文档,但我没有找到办法。 Anyone had an experience with this? 有人有这方面的经验吗?

I don't think that you can customize the plugin in other ways but the ones that facebook offer you in the plugin page itself. 我不认为您可以通过其他方式自定义插件,但Facebook在插件页面中为您提供的插件。

More than that, I advise against customizing their plugins since then you'll have to stay up to date with every little change they make so that your changes would still have the desired effect. 更重要的是,我建议不要自定义他们的插件,因为那时你必须及时了解他们所做的每一个小改动,这样你的改变仍然会产生预期的效果。

What you can do how ever is to create your own plugin for that. 你可以做什么,为此创建自己的插件。 You can use the graph api to add comments yourself to a page, link, what not. 你可以使用图形api自己添加评论到页面,链接,什么不是。 And so, what you can do is just put a textarea and when the user submits a new comment save it (if you want/need to) and then make a api request to add the comment to this url (POST): 所以,你可以做的只是放一个textarea,当用户提交一个新的注释保存它(如果你想/需要),然后发出api请求将注释添加到这个url(POST):

https://graph.facebook.com/LINK_ID/comments

with the message parameter. 使用message参数。 You also need to have the publish_stream permission though. 您还需要拥有publish_stream权限。

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

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