'882679601843440', 'secret' => '72d774ea8d61702438a51138e5456f20' ));*/ $fb = new Facebook\Facebook([ 'app_id' => '882679601843440', 'app_secret' => '72d774ea8d61702438a51138e5456f20', 'default_graph_version' => 'v2.6', ]); $helper = $fb->getRedirectLoginHelper(); $permissions = ['email']; // optional try { if (isset($_SESSION['facebook_access_token'])) { $accessToken = $_SESSION['facebook_access_token']; } else { $accessToken = $helper->getAccessToken(); } } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } if (isset($accessToken)) { if (isset($_SESSION['facebook_access_token'])) { $fb->setDefaultAccessToken($_SESSION['facebook_access_token']); } else { // getting short-lived access token $_SESSION['facebook_access_token'] = (string) $accessToken; // OAuth 2.0 client handler $oAuth2Client = $fb->getOAuth2Client(); // Exchanges a short-lived access token for a long-lived one $longLivedAccessToken = $oAuth2Client->getLongLivedAccessToken($_SESSION['facebook_access_token']); $_SESSION['facebook_access_token'] = (string) $longLivedAccessToken; // setting default access token to be used in script $fb->setDefaultAccessToken($_SESSION['facebook_access_token']); } // redirect the user back to the same page if it has "code" GET variable if (isset($_GET['code'])) { header('Location: ./'); } // getting basic info about user try { $profile_request = $fb->get('/me?fields=id,name,first_name,last_name,email'); $profile = $profile_request->getGraphNode()->asArray(); } catch(Facebook\Exceptions\FacebookResponseException $e) { // When Graph returns an error echo 'Graph returned an error: ' . $e->getMessage(); session_destroy(); // redirecting user back to app login page header("Location: ./"); exit; } catch(Facebook\Exceptions\FacebookSDKException $e) { // When validation fails or other local issues echo 'Facebook SDK returned an error: ' . $e->getMessage(); exit; } // printing $profile array on the screen which holds the basic info about user //print_r($profile); // Now you can redirect to another page and use the access token from $_SESSION['facebook_access_token'] } if(isset($_POST["yorum"])) { $kullSql=mysql_query("select kullanici_id from kullanicilar where facebook_id='".$_POST["fbid"]."' "); $kullaniciid=mysql_result($kullSql,0,'kullanici_id'); $tarih=date("d-m-Y"); mysql_query("INSERT INTO yorumlar(yorum_id, ilan_id, yorum_baslik, yorum_aciklama, kullanici_id, yorum_tarih) VALUES ('','".$_POST["ilanid"]."','".$_POST["baslik"]."','".$_POST["text"]."','".$kullaniciid."','".$tarih."')"); } function get_web_page($url) { $options = array (CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers //CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "test", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect CURLOPT_CONNECTTIMEOUT => 30, // timeout on connect CURLOPT_TIMEOUT => 30, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_SSL_VERIFYPEER => false // Disabled SSL Cert checks ); $ch = curl_init ( $url ); curl_setopt_array ( $ch, $options ); $content = curl_exec ( $ch ); $err = curl_errno ( $ch ); $errmsg = curl_error ( $ch ); $header = curl_getinfo ( $ch ); $httpCode = curl_getinfo ( $ch, CURLINFO_HTTP_CODE ); curl_close ( $ch ); $header ['errno'] = $err; $header ['errmsg'] = $errmsg; $header ['content'] = $content; return $header ['content']; } ?> ilan yorumları İlanYorumu.com

İlan Ara


Lütfen aradığınız ilanın linkini yazınız...
0) { $satir=mysql_fetch_array($ilan_varmiSql); } else{ $url = $_POST["keyword"]; $sourceUrl = parse_url($url); $site = $sourceUrl['host']; echo $site."
"; if($site=="www.sahibinden.com") { $scheme = $sourceUrl['scheme']. '://'; echo $scheme."
"; $path =$sourceUrl['path']; echo $path ."
"; $baslik=str_replace("/", ">",substr($path,1) ); $baslik=substr($baslik, 0,strrpos($baslik, ">")); $ilanno=end(explode("-", $baslik)); echo $ilanno."
"; $baslik=substr($baslik, 0,strrpos($baslik, $ilanno)); $baslik=str_replace("-", " ",$baslik ); $baslik=strtoupper($baslik); $baslik=str_replace("PLUS", "+",$baslik ); echo $baslik; $tarih=date("d-m-Y"); mysql_query("INSERT INTO ilanlar(ilan_id, ilan_baslik, ilan_resim, site_id, aranma_tarih, hit,site,link,ilanSehir,ilanIlce,fiyat) VALUES ('', '".$baslik."', '', '".$ilanno."', '".$tarih."', 0, '".$site."', '".$_POST["keyword"]."', '', '', '')"); $ilan_id=mysql_insert_id(); $ilanIDSql=mysql_query("select * from ilanlar where ilan_id='".$ilan_id."'"); $satir=mysql_fetch_array($ilanIDSql); } ////////hurriyet emlak ise if($site=="www.hurriyetemlak.com") { $scheme = $sourceUrl['scheme']. '://'; echo $scheme."
"; $path =$sourceUrl['path']; echo $path ."
"; $baslik=str_replace("/", ">",substr($path,1) ); $baslik=substr($baslik, 0,strrpos($baslik, ">detay")); $ilanno=end(explode("/", $path)); echo $ilanno."
"; //$baslik=substr($baslik, 0,strrpos($baslik, ">detay")); $baslik=str_replace("-", " ",$baslik ); $baslik=strtoupper($baslik); $baslik=str_replace("PLUS", "+",$baslik ); echo $baslik; $tarih=date("d-m-Y"); mysql_query("INSERT INTO ilanlar(ilan_id, ilan_baslik, ilan_resim, site_id, aranma_tarih, hit,site,link,ilanSehir,ilanIlce,fiyat) VALUES ('', '".$baslik."', '', '".$ilanno."', '".$tarih."', 0, '".$site."', '".$_POST["keyword"]."', '', '', '')"); $ilan_id=mysql_insert_id(); $ilanIDSql=mysql_query("select * from ilanlar where ilan_id='".$ilan_id."'"); $satir=mysql_fetch_array($ilanIDSql); } } } if(isset($_GET["id"])) { $ilan_id=$_GET["id"]; $ilanIDSql=mysql_query("select * from ilanlar where ilan_id='".$_GET["id"]."'"); $satir=mysql_fetch_array($ilanIDSql); } echo '

'.$satir["ilan_baslik"].'

İlan Numarası : '.$satir["site_id"].'
'; echo '
'; // $userid = $facebook->getUser(); //echo "fbid".$facebook->getUser(); // eğer kullanıcı giriş yapmışsa profil ve arkadaş listesi bilgilerini alalım /*if ( $userid ){ try { $profile = $facebook->api('/me'); $_SESSION["uid"]=$userid; } catch ( FacebookApiException $e ){ print $e->getMessage(); $userid = null; } } // giriş ve çıkış url'lerini belirleyelim if ( $userid ){ $logout = $facebook->getLogoutUrl(array( 'next' => 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] )); } else { $login = $facebook->getLoginUrl(array( 'scope' => 'public_profile, email', 'redirect_uri'=>'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']."?id=".$ilan_id )); }*/ // print_r($profile); if (isset($profile)) { foreach ( $profile as $key => $val ){ if ( !is_array($val) ) // print $key.' : '.$val.'
'; $bilgi[$key]=$val; } } $cikis=""; $yorumBox=""; if (isset($bilgi)) { $userid = $bilgi["id"]; } // profil ve arkadaş listesi bilgilerini yazdıralım if (isset($accessToken)) { $logout=$helper->getLogoutUrl( $accessToken, 'http://ilanyorumu.com/ilandetay.php?id='.$ilan_id); $cikis= 'Çıkış Yap'; $yorumBox="


"; $kullaniciSql=mysql_query("select * from kullanicilar where facebook_id='".$bilgi["id"]."' "); $kullaniciSayi=mysql_num_rows($kullaniciSql); $kullaniciSatir=mysql_fetch_array($kullaniciSql); echo "
".''.$kullaniciSatir["isim"].''.'  '. $cikis.$yorumBox.'
'; if($kullaniciSayi<1) { mysql_query("insert into kullanicilar (kullanici_id,facebook_id,isim,eposta) values('','".$bilgi["id"]."','".$bilgi["name"]."','')"); } } else { if (!isset($accessToken)) { // replace your website URL same as added in the developers.facebook.com/apps e.g. if you used http instead of https and you used non-www version or www version of your website then you must add the same here $loginUrl = $helper->getLoginUrl('http://www.ilanyorumu.com/ilandetay.php?id='.$ilan_id, $permissions); echo 'Yorum Yazmak için Facebook ile Bağlan!'; } } echo ' '; $yorumSql=mysql_query("select * from yorumlar where ilan_id='".$ilan_id."'"); $yorumsayi=mysql_num_rows($yorumSql); if($yorumsayi<1) { echo "

Henüz Yorum Yapılmamış

"; } else { echo '

Yapılan Yorumlar

'; while($satir=mysql_fetch_array($yorumSql)) { $kullaniciSql=mysql_query("select * from kullanicilar where kullanici_id='".$satir["kullanici_id"]."' "); $kullaniciSatir=mysql_fetch_array($kullaniciSql); $isim=$kullaniciSatir["isim"]; $fbid=$kullaniciSatir["facebook_id"]; echo "
"; echo "
"."" .$isim.""; echo "

".$satir["yorum_baslik"]."

". $satir["yorum_aciklama"] ."
".$satir["yorum_tarih"]."
"; } } echo '
'; ?>

İlanYorumu.com, Sahibinden ve Hurriyet Emlak sitelerindeki müşterilerin daha kaliteli hizmet alabilmsesi için başlatılmış bir projedir.

© Copyright 2016 - İlanYorumu.com - Bir Maxithings Projesidir.