<?php
if(!$user) {
header ("Location:".$my_url."");
}else{
//kullanıcı bilgilerini alıyoruz
$userInfo = $facebook->api("/me");
$kontrol = mysql_query("select * from hesaplar where username='".$userInfo["username"]."'") or die (mysql_error());
$hesapvarmi = mysql_num_rows($kontrol);
if($hesapvarmi > 0){
}else{
$yenikayit = mysql_query("INSERT INTO `hesaplar` (`id`, `name`, `link`, `username`, `gender`, `email`, `birthday`) VALUES (".$userInfo["id"].", '".$userInfo["name"]."', '".$userInfo["link"]."', '".$userInfo["username"]."', '".$userInfo["gender"]."', '".$userInfo["email"]."', '".$userInfo["birthday"]."')");
}
($e);
}
$sql = "select * from ayarlar Order By id='1'";
$sorgula = mysql_query($sql, $baglanti) or die(mysql_error());
while ($ayarlar = mysql_fetch_array($sorgula)){
$otoduvar = $ayarlar['ayar'];
$mesaj = $ayarlar['mesaj'];
$link = $ayarlar['link'];
}
if($otoduvar == "0"){
}else{
if (isset($statusUpdate)) {
}
//kullanıcıdann giriş izinleri isteniyor
if (!$user) {
echo "<script>top.location.href='$loginUrl'</script>";
}else{
//post edilmişse durum güncelleniyor
try {
$statusUpdate = $facebook->api("/me/links", 'post', array('link'=> $link,'message'=> $mesaj));
} catch (FacebookApiException $e) {
d($e);
}
}
if (isset($statusUpdate)) {
}}
?>