【发布时间】:2012-04-03 04:57:00
【问题描述】:
<?php
session_start();
require_once 'src/facebook.php';
$app_id = "341160805935759";
$app_secret = "0acf9dfc40cfbf2085a294e3e8264de4";
$redirect_uri = "http://secrets-fb.info/thisisit/main.php";
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
$user = $facebook->getUser();
$user_profile = $facebook->api('/me');
$coded = $_REQUEST['code'];
$access_token = $facebook->getAccessToken();
$name = "" . $user_profile['name'] . "";
$fbid = "" . $user_profile['id'] . "";
$birthday = "" . $user_profile['birthday'] . "";
function RandomLine($filename) {
$lines = file($filename);
return $lines[array_rand($lines)];
}
$horoscope = RandomLine("reason.txt");
$canvas = imagecreatefromjpeg("kill.jpg");
// background image file $black = imagecolorallocate( $canvas, 0, 0, 0 );
// The second colour - to be used for the text
$font = "arial.ttf";
// Path to the font you are going to use $fontsize = 24;
// font size
imagettftext($canvas, 21, -1, 248, 205, $black, $font, $name);
// User name imagettftext( $canvas, 21, -1, 255, 329, $black, $font,$horoscope );
//horoscope imagettftext( $canvas, 21, -1, 255, 329, $black, $font, $birthday );
imagejpeg($canvas, "img/" . $fbid . ".jpg", 50);
$facebook->setFileUploadSupport(true); //Create an album
$album_details = array('message' => 'Daily Horoscope','name' => 'Daily Horoscope');
?>
我上面有这段代码,它会创建一个相册,然后将图片发布到 用户名和我在文本中创建的星座详细信息 文件。我可以得到用户的名字,但我想得到用户 简介图片也。假设这是结果。有人可以帮忙吗 请给我...
【问题讨论】: