0
因爲我是新的facebook圖形API,但我知道的基本知識。現在我需要你的幫助,所有如何閱讀用戶牆貼和其他誰張貼在任何用戶的牆上,與read_stream。但我不知道如何打電話。我嘗試了一些方法,但我能夠讀取絕對名稱和基本信息。閱讀對象時需要幫助。請幫幫我!!!無法獲取Facebook Cookie和執行代碼
<?php header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND
CNT"');?>
<?php
define('FACEBOOK_APP_ID', 'xxxxx');
define('FACEBOOK_SECRET', 'xxxxxxxxx');
function get_facebook_cookie($app_id, $application_secret) {
$args = array();
print_r($_COOKIE);
parse_str(trim($_COOKIE['fbs_' . $app_id], '\\"'), $args);
ksort($args);
$payload = '';
foreach ($args as $key => $value) {
if ($key != 'sig') {
$payload .= $key . '=' . $value;
}
}
if (md5($payload . $application_secret) != $args['sig']) {
return null;
}
return $args;
}
$cookie = get_facebook_cookie($app_id, $application_secret);
echo 'The ID of the current user is ' . $cookie['uid'];
?>
<html>
<body>
<?php if ($cookie) { ?>
Your user ID is <?= $cookie['uid'] ?>
<?php } else { ?>
<fb:login-button>Install Example App</fb:login-button>
<?php } ?>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({appId: 'xxxxxx', xfbml: true,cookie:true});
FB.Event.subscribe('auth.login', function(response) {
// Reload the application in the logged-in state
window.top.location = 'http://apps.facebook.com/fbvantivirus';
});
</script>
<div style="display:none">
</body>
</html>
我有提到整個code.please做幫助me.am從去年掙扎week..all嘗試vain.Thanks提前。 :)