0

我想使用 sdk 和 facebook 登录按钮(令牌操作)集成开放图问题是 smarty 模板 tpl 文件

事实上,我在简单的 html 文件上测试了我所有的代码,它的工作原理就像一个魅力:http: //zdig1.biz/1.htm

当我将其报告给 tpl 文件时,相同的代码无法通过添加 {literal} 来工作,您可以将其他链接与此 http://zdig1.biz/video/naruto-shippuden/317-video_7605be4c2.html进行比较

facebook 按钮称为时间线不退出,而 publich 一个不工作

    <div id="fb-root"></div>
{literal}<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '48439698629', 
      channelUrl : '//zdig1.biz/channel.html',
      status     : true, 
      cookie     : true, 
      xfbml      : true  
    });
  };
  (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_US/all.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));
</script>{/literal}

    {literal}<script type="text/javascript">
  function postArticle()
  {
     FB.api(
  'me/video.watches',
  'post',
  {
    video: "http://zdig1.biz/video/naruto-shippuuden/321-video_f69d2a355.html"
  },
        function(response) {
           if (!response || response.error) {
              alert('Post was not published.');
           } else {
              alert('Post was published. Action ID: ' + response.id);
           }
        });
  }
  </script>{/literal}

和行动一

        <fb:login-button onlogin = 'postArticle()' perms="email,publish_actions,user_actions.video">
Timeline
</fb:login-button>
or 
<fb:add-to-timeline></fb:add-to-timeline>
 <form>
 <input type="button" value="Publish" onclick="postArticle()" />
 </form>
4

1 回答 1

0

解决方案是:

 <fb:login-button onlogin='postlike()' perms="email,publish_actions,user_actions.video">Timeline</fb:login-button> 
于 2013-09-09T02:33:11.297 回答