<?php
header('Content-type: text/html; charset=utf8'); // türkçe dil sorunu için
require 'src/facebook.php'; // facebook php sdk
// facebook'a uygulama bilgilerimizi gönderip izin alalım
$facebook = new Facebook(array(
'appId' => '2327555168aaaaaaaaaaa',
'secret' => '2293790f856adf360400aaaaaaa'
));
// kullanıcı giriş yapmış ise onun kullanıcı id'sini alalım
$userid = $facebook->getUser();
// eğer kullanıcı giriş yapmışsa profil ve arkadaş listesi bilgilerini alalım
if ( $userid ){
try {
$profile = $facebook->api('/me');
$friendlists = $facebook->api('/me/friends');
$education = $facebook->('me/buraya work,education birçok şey denedim facebook kütüphanesinede baktım belirmiyor konuya girin herkese teşekkürler)
} catch ( FacebookApiException $e ){
print $e->getMessage();
$userid = null;
}
}
// giriş ve çıkış url'lerini belirleyelim
if ( $userid ){
$logout = $facebook->getLogoutUrl(array(
'next' => 'http://www.site/index.php'
));
} else {
$login = $facebook->getLoginUrl(array(
'scope' => 'user_birthday, read_friendlists, user_education_history ,user_about_me'
));
}
// profil ve arkadaş listesi bilgilerini yazdıralım
if ( $userid ){
print '<a href="'.$logout.'">Çıkış Yap</a>';
print '<h2>Kişisel Bilgiler</h2>';
// print_r($profile);
foreach ( $profile as $key => $val ){
if ( !is_array($val) )
print $key.' : '.$val.'<br />';
}
print '$education';
print '<h2>Arkadaş Listen</h2>';
// print_r($friendlists);
foreach ( $friendlists['data'] as $friend ){
print '<a href="https://facebook.com/profile.php?id='.$friend['id'].'" target="_blank" style="float: left; margin: 2px">
<img src="https://graph.facebook.com/'.$friend['id'].'/picture" width="20" height="20" />
</a>';
}
} else {
print '<a href="'.$login.'">Giriş Yap</a>';
}--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 18:54:06 -->-> Daha önceki mesaj 18:52:50 --
education değişkeninde belirttiğim gibi 10 günden beri uğraşıyorum bi türlü çözemedim bilem hocamlarım bi el atsın