-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> 
+0

常见问题:你到目前为止尝试过什么?请包括你的研究和你的代码。 – luschn

+0

您好luschn,我试图做的是自动喂我的客户的意见,在我的Facebook页面。我正在使用Feed,但我需要添加审阅明星。 –

+0

现在你失去了我。你想发布评论到Facebook吗?或者你想创建自己的明星评级系统? – luschn

回答