2012-12-30 211 views
1

任何指導如何做一些事情,當用戶使用Facebook登錄我的網站時,它會自動使用他們的Facebook帳戶發佈狀態,如「John剛加入mysite.com」等等他們的朋友會看到。任何這樣的事情?Facebook發佈到用戶牆

回答

0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
    <title>Facebook post</title> 
    </head> 
    <body onload="publishWallPost('{{ page.slug }}')"> 
    <script> 
    window.fbAsyncInit = function() { 
     FB.init({appId: 'Your Super Cool App ID', status: true, cookie: true, xfbml: true}); 
      }; 
     (function() { 
      var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; 
      document.getElementById('fb-root').appendChild(e); 
     }()); 
    </script> 




    <script> 
    <!-- 
    function publishWallPost(slug) { 
     var attachment = {'name':'My Super Cool Website','description':'This is a test of the Facebook Broadcast System. If this was real, you would be reading something useful.','media':[{'type':'image','src':'http://MySuperCoolWebsite.com/images/facebook_image.png','href':'http://www.MySuperCoolWebsite.com/' + slug + '/'}]}; 
     FB.ui({ 
      method: 'stream.publish', 
      message: 'I just found this Super Cool Website!', 
      attachment: attachment, 
      user_message_prompt: 'post this to your wall?' 
     }); 
    } 
    //--> 
    </script> 
    </body> 
</html> 
+0

非常感謝,我把它放在哪裏,撒謊什麼頁? – user1917642

+0

這是一個通過PHP在Facebook上上傳封面照片的教程。 http://socialdevelopers.wordpress.com/2013/01/03/facebook-covers-photo-php-script/ –