Facebook graph api 查看带有评级的fb按钮
我试图在我的网站上设置一个按钮,让我们的客户在我们的Facebook页面上发表评论。我需要这个按钮来打开一个类似于FB.ui提要对话框的对话框,但是可以用Facebook评论中使用的五星风格来评价评论?我可以用php o javascript实现吗 我的源代码:Facebook graph api 查看带有评级的fb按钮,facebook-graph-api,facebook-javascript-sdk,facebook-php-sdk,Facebook Graph Api,Facebook Javascript Sdk,Facebook Php Sdk,我试图在我的网站上设置一个按钮,让我们的客户在我们的Facebook页面上发表评论。我需要这个按钮来打开一个类似于FB.ui提要对话框的对话框,但是可以用Facebook评论中使用的五星风格来评价评论?我可以用php o javascript实现吗 我的源代码: <script type="text/javascript"> x$.ready(function () { x$('#share_button').click(fu
<script type="text/javascript">
x$.ready(function () {
x$('#share_button').click(function (e) {
e.preventDefault();
FB.ui(
{
method: 'feed',
name: '<?php echo $linkname;?>',
link: '<?php echo $link;?>',
<?php if (isset($campaign->facebook_image) && $campaign->facebook_image != '' && $campaign->facebook_image != null) { ?>
picture: '<?php echo 'bo.opinat.com' . DIRECTORY_SEPARATOR . 'facebookimages' . DIRECTORY_SEPARATOR . $campaign->id . DIRECTORY_SEPARATOR .$campaign->facebook_image; ?>',
<? } ?>
caption: '<?php echo $linkcaption;?>',
description: '<?php echo $linkdescription;?>'
},
function (response) {
if (response && !response.error_message) {
FB.api('/' + response.post_id, function (response) {
x$().xhr('<?php echo Yii::app()->createUrl('survey/saveSocialMediaPost', array('answer_id' => $answer->id, 'social_network' => 1, 'state' => 'P', 'user_id' => $campaignCenter->social_media_user)); ?>', {
method: 'POST',
async: true,
data: 'message=' + response.message + '&post_id=' + response.id,
});
console.log(response.message);
});
}
else {
x$().xhr('<?php echo Yii::app()->createUrl('survey/saveSocialMediaPost', array('answer_id' => $answer->id, 'social_network' => 1, 'state' => 'E', 'user_id' => $campaignCenter->social_media_user)); ?>', {
method: 'POST',
async: true,
data: 'message=' + response.error_message + '&post_id=' + response.error_code,
});
}
}
);
});
});
</script>
x$.ready(函数(){
x$(“#共享按钮”)。单击(功能(e){
e、 预防默认值();
FB.ui(
{
方法:“提要”,
名称:“”,
链接:“”,
图片:'',
标题:'',
说明:“”
},
功能(响应){
if(响应&!响应.错误消息){
FB.api('/'+response.post_id,函数(response){
x$().xhr(“”{
方法:“POST”,
async:true,
数据:'message='+response.message+'&post_id='+response.id,
});
console.log(response.message);
});
}
否则{
x$().xhr(“”{
方法:“POST”,
async:true,
数据:“message=”+response.error\u message+”&post\u id=”+response.error\u代码,
});
}
}
);
});
});
正如您在文档中看到的,您不能使用API发布评论/评级:
无法在此终结点上执行此操作
通常的问题是:到目前为止你尝试了什么?请包括您的研究和代码。嗨,luschn,我想做的是在我的Facebook页面上自动提供客户的意见。我正在使用feed,但我需要添加评论明星。现在你已经失去了我。你想在facebook上发布评论吗?或者你想用明星创建自己的评级系统?只是发布评论。在这种情况下,答案很简单