2012-01-01 77 views
0

我使代碼工作!但這是一個小問題。張貼在牆上的圖像非常小。 代碼上傳照片在相冊中,然後發佈信息到牆上。但貼在牆上的圖片太小了。當您打開一個圖庫時,打開已創建的相冊,然後點擊分享照片並選擇牆壁,然後在牆上出現BIG PHOTO。那麼,如何使用PHP SDK在牆上張貼BIG照片?請幫幫我。我正在學習明天的測試,請爲我修改代碼。我沒有太多時間。張貼在專輯的牆上照片,但更大

function publish($text, $data,$image1,$file1) // publikuje na Tablicy 
{ 
$facebook = new Facebook(array(
'appId' => '225192487556449', 
    'secret' => '8546fb31fa6f00aa2068b04b65544353', 
'access_token' => $data['token'] 
)); 

$message = 'Check out that!'; 


$attachment = array(
     'access_token' => $access_token, 
     'message' => $text, 
     'name' => "", 
     'link' => "@".$file1, 
     'description' => "Tak może wyglądać mój nagrobek :(", 
     'picture'=> $image1, 
     ); 

$facebook->setFileUploadSupport('http://www.szymad.pl/facebook'); 
     $response = $facebook->api(
      '/me/photos/', 
      'post', 
      array(
      'message' => $text, 
      'source' => '@'.$file1 // @-sign must be the first character 
     ) 
     ); 




$wynik = $facebook->api('/me/feed', 'POST', $attachment); 
//$wynik = json_decode($wynik); 
if($wynik['error']) 
echo $wynik['error']['type'].': '.$wynik['error']['message']; 
else 
echo "<br />Wpis został opublikowany!"; 
} 
+0

嘗試上傳下的長城照片相冊照片。解釋[這裏] [1] [1]:http://stackoverflow.com/questions/8424013/how-to-include-on-the-wall-a-photo-post-though-graph -API – 2012-01-02 10:57:39

回答

1
$facebook->setFileUploadSupport(true); 
     $response = $facebook->api(
      '/me/photos/', 
      'post', 
      array(
      'message' => $text, 
      'source' => '@'.realpath($file1) // @-sign must be the first character 
     ) 
     );