2013-07-14 56 views
0

我已經使用自動郵政這段代碼我的Facebook粉絲頁面汽車後的Facebook粉絲頁面3.2.2

<?php 

// Requires Facebook PHP SDK 3.0.1: https://github.com/facebook/php-sdk/ 
require ('facebook.php'); 

define('FACEBOOK_APP_ID',"YOUR-APP-ID"); 
define('FACEBOOK_SECRET',"YOUR-APP-API-SECRET"); 

$user = null; 

$facebook = new Facebook(array(
    'appId' => FACEBOOK_APP_ID, 
    'secret' => FACEBOOK_SECRET, 
    'cookie' => true 
)); 

$user = $facebook->getUser(); // Get the UID of the connected user, or 0 if the Facebook user is not connected. 

if($user == 0) { 

    /** 
    * Get a Login URL for use with redirects. By default, full page redirect is 
    * assumed. If you are using the generated URL with a window.open() call in 
    * JavaScript, you can pass in display=popup as part of the $params. 
    * 
    * The parameters: 
    * - redirect_uri: the url to go to after a successful login 
    * - scope: comma separated list of requested extended perms 
    */ 

    $login_url = $facebook->getLoginUrl($params = array('scope' => "publish_stream")); 

    echo ("<script> top.location.href='".$login_url."'</script>"); 

} else { 

    try { 
      $params = array(
       'message'  => "Hurray! This works :)", 
       'name'   => "This is my title", 
       'caption'  => "My Caption", 
       'description' => "Some Description...", 
       'link'   => "http://stackoverflow.com", 
       'picture'  => "http://i.imgur.com/VUBz8.png", 
      ); 

      $post = $facebook->api("/$user/feed","POST",$params); 

      echo "Your post was successfully posted to UID: $user"; 

     } 
     catch (FacebookApiException $e) { 
      $result = $e->getResult(); 
     } 

} 

?> 

上,但我需要張貼我的Facebook粉絲頁面上有我的粉絲頁面名稱,這scrpit工作如此之好,但這個代碼發佈在我的粉絲頁面與我的管理員帳戶,而不是像我的粉絲頁面。

PLZ HELP ME :(

回答

0

我想你需要仔細看看這article仔細,我使用了那裏提到的步驟。

+0

文章被刪除,所以你的答案是毫無價值的。下次請自己回答。 –