0
私はFacebookのためのアプリケーションを配布しようとしています。ここでは、ユーザープロファイルのイメージを背景イメージとユーザーの名前でマージします。この画像は、クイズに成功した人の報酬です。merge facebook profile with text and image
これは、ユーザーがそこに答えを提出した後direcetedされているページからrelavantコードです:
if ($totalCorrect == 10) {
echo "Congrats!";
echo "<div id='results'>$totalCorrect/10 correct</div>";
echo '<img src="image.php">';
?>
そして、私は$を交換した場合、これはimage.php
<?php
// Create image instances
$im = imagecreatefromjpeg('xxx.jpg');
$black = ImageColorAllocate($im, 0, 0, 0);
//The canvas's (0,0) position is the upper left corner
//So this is how far down and to the right the text should start
$start_x = 200;
$start_y = 20;
$font = 'arial.ttf';
Imagettftext($im, 12, 0, $start_x, $start_y, $black, $font, 'text to write');
$url = "http://graph.facebook.com/".$user_profile. "/picture";
$dest = imagecreatefromjpeg($url);
// Copy and merge
imagecopymerge($im, $dest, 10, 10, 0, 0, 180, 180, 100);
//Creates the jpeg image and sends it to the browser
//100 is the jpeg quality percentage
// Output and free from memory
header('Content-Type: image/jpg');
imagejpeg($im);
imagedestroy($dest);
imagedestroy($src);
?>
のコードですコードは動作しますが、ユーザーのプロファイルを取得しようとしたときには表示されません。助言がありますか?ありがとうございました!