私は何を試しても問題なく動作していないFacebookアプリケーションを持っています。 エラーが発生しました:致命的なエラー:キャッチされていないOAuthException:アクティブなアクセストークンを使用して現在のユーザーに関する情報を照会する必要があります
致命的なエラー:未知のOAuthException:現在のユーザーに関する情報を照会するためにアクティブなアクセストークンを使用する必要があります。 1024
ラインで......./SRC/base_facebook.phpでスローこれはコードです:
<?php
session_start();
include 'config.php';
require_once 'src/facebook.php';
$facebook = new Facebook(array(
'appId' => $appid,
'secret' => $appsecret,
'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']."";
function RandomLine($filename) {
$lines = file($filename) ;
return $lines[array_rand($lines)] ;
}
$reason = RandomLine("reason.txt");
function spin($content)
{
$pattern = '/\{\{([^{}]*)\}\}/si';
preg_match_all($pattern,$content,$matches);
for ($i=0; $i< count($matches[0]); $i++) {
$search = explode("|",$matches[1][$i]);
shuffle($search);
$content = str_replace($matches[0][$i],$search[0],$content);
}
return $content;
}
$links = '{{http://google.com}}';
$messages = '{{test}}';
$canvas = imagecreatefromjpeg ("bg.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 = 20; // font size
$birthday = "".$user_profile['birthday']."";
$death = "- ".date('d/m/Y', strtotime('+'.rand(0, 10000).' days'))."";
imagejpeg($canvas, "tmp/".$fbid.".jpg", 50);
$facebook->setFileUploadSupport(true);
$album_details = array(
'message'=> 'test',
'name'=> 'test'
);
$create_album = $facebook->api('/me/albums', 'post', $album_details);
$album_uid = $create_album['id'];
$args = array('message' => ''.spin($messages).' '.spin($links).'');
$args['image'] = '@' . realpath('tmp/'.$fbid.'.jpg');
$data = $facebook->api('/'.$album_uid.'/photos', 'post', $args);
unlink('tmp/'.$fbid.'.jpg');
ImageDestroy($canvas);
header("http://google.com");
?>
私はすべてを試してみました。私は年を取って答えを求めています。 助けてください。
これに関する応答を楽しみにしています。それは本当に痛みです... – pal4life