-1
我試圖在我的網站上放一個按鈕,以允許我們的客戶在我們的Facebook頁面上放置評論。我需要這個按鈕來打開一個類似於FB.ui提要對話框的對話框,但可以使用Facebook評論中使用的5星形式對評論進行評分。我可以用PHP或JavaScript來做到這一點嗎?評論fb button,評分
我的飼料代碼:
<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>
常見問題:你到目前爲止嘗試過什麼?請包括你的研究和你的代碼。 – luschn
您好luschn,我試圖做的是自動餵我的客戶的意見,在我的Facebook頁面。我正在使用Feed,但我需要添加審閱明星。 –
現在你失去了我。你想發佈評論到Facebook嗎?或者你想創建自己的明星評級系統? – luschn