Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include($_SERVER["DOCUMENT_ROOT"]."/class/facebook/facebook.php");
- include($_SERVER["DOCUMENT_ROOT"]."/class/database.php");
- include($_SERVER["DOCUMENT_ROOT"]."/class/tools.php");
- include($_SERVER["DOCUMENT_ROOT"]."/class/sefyapi.php");
- include($_SERVER["DOCUMENT_ROOT"]."/class/metatag.php");
- ob_start();
- class Oyun{
- function __construct($vt_kullanici,$vt_parola,$vt_isim,$vt_sunucu,$vt_cache_sure){
- if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
- $domainadi = substr($_SERVER['HTTP_HOST'], 3);
- } else {
- $domainadi = str_replace(array_shift(explode(".",getenv("HTTP_HOST"))),"",$_SERVER['HTTP_HOST']);
- }
- $this->alanadi = $domainadi;
- $this->db = new AlpSQL($vt_isim,$vt_kullanici,$vt_parola,$vt_sunucu,$vt_cache_sure);
- $this->arac = new AlpTools;
- $this->swfayar = $this->db->sorgu("select oyunswf from ayarlar where id='1'","1","ayarlar");
- $this->sefyapi = $this->db->sorgu("select etiket,sayfaek,yenioyunlar,populeroyunlar,enguzeloyunlar,onerilenoyunlar,yardim,iletisim,kategori,oyun,oyunoyna,katpopuleroyunlar,katenguzeloyunlar,katonerilenoyunlar,uyeprofil,blog,blogurl,blogkategori from sefyapi where id='1'","1","sefyapi");
- $connectislem = $this->db->sorgu("select fblogin,fbappid,fbsecretid,fakesubdomain,oyun from ayarlar where id='1'","0","uye");
- $this->oyunum = $connectislem[0]->oyun;
- $this->fakesubdomain = $connectislem[0]->fakesubdomain;
- if(!empty($_GET["kontrol"])){
- $this->anakontrol();
- }
- $this->link();
- $this->facebooklogis = $connectislem[0]->fblogin;
- $this->sef = new AlpSefyapi($this->sefyapi,$connectislem[0]->fakesubdomain);
- $this->metatag = new AlpMetatag;
- if($connectislem[0]->fblogin=="1" and $_GET["ser"]!="" and $_COOKIE["giris"]==""){
- $this->fbappid = $connectislem[0]->fbappid;
- $this->facebooklogin = new Facebook(array('appId' => $connectislem[0]->fbappid,'secret' => $connectislem[0]->fbsecretid,'cookie' => true,));
- $this->facebookislem();
- }
- }
- function clearMethod($mVar){
- if(is_array($mVar)){
- foreach($mVar as $gVal => $gVar){
- if(!is_array($gVar)){
- $mVar[$gVal] = htmlspecialchars(strip_tags(urldecode(mysql_escape_string(addslashes(stripslashes(stripslashes(trim(htmlspecialchars_decode($gVar)))))))));
- }else{
- $mVar[$gVal] = $this->clearMethod($gVar);
- }
- }
- }else{
- $mVar = htmlspecialchars(strip_tags(urldecode(mysql_escape_string(addslashes(stripslashes(stripslashes(trim(htmlspecialchars_decode($mVar)))))))));
- }
- return $mVar;
- }
- function canonical($veri,$adres){
- $adres = $adres."/x/x";
- $son = substr($veri, -1);
- preg_match_all("@".$this->sefyapi[0]->sayfaek."/(.*?)/(.*?)@",$adres,$m);
- if(empty($m[1][0])){
- $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
- }else{
- if($son=="/"){
- $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
- $adres2 = str_replace($this->sefyapi[0]->sayfaek."/".$m[1][0],"",$adres2);
- }else{
- $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
- $adres2 = str_replace("/".$this->sefyapi[0]->sayfaek."/".$m[1][0],"",$adres2);
- }
- }
- return $adres2;
- }
- function link(){
- $link = $this->oyunum;
- $link = str_replace("&","",$link);
- if(empty($link)){
- return $this->anakontrol();
- }else{
- $link = base64_decode($link);
- if(strstr($link, "href")){
- return $link;
- }else{
- return $this->anakontrol();
- }
- }
- }
- function cekim($url,$timeout=null){
- $ch = curl_init();
- if(empty($timeout)){
- $timeout = "5";
- }
- curl_setopt($ch,CURLOPT_URL,$url);
- curl_setopt($ch,CURLOPT_HEADER,false);
- curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
- curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
- curl_setopt($ch,CURLOPT_REFERER,"http://www.google.com.tr");
- curl_setopt($ch,CURLOPT_USERAGENT,"inforesimoyun");
- $data = curl_exec($ch);
- curl_close($ch);
- return $data;
- }
- function anakontrol(){
- if($this->fakesubdomain=="1"){
- if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
- $domainadi = substr($_SERVER['HTTP_HOST'], 4);
- } else {
- $domainadi = str_replace(array_shift(explode(".",getenv("HTTP_HOST"))),"",$_SERVER['HTTP_HOST']);
- $domainadi = str_replace($domainadi,"@".$domainadi,$domainadi);
- $domainadi = str_replace("@.","",$domainadi);
- $domainadi = str_replace("@","",$domainadi);
- }
- }else{
- if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
- $domainadi = substr($_SERVER['HTTP_HOST'], 4);
- } else {
- $domainadi = $_SERVER['HTTP_HOST'];
- }
- }
- $alanadim = $domainadi;
- $kaynak = $this->cekim("http://www.forumbornova.net/kontrol.php?x=".$alanadim);
- preg_match_all("@<durum>(.*?)</durum>@",$kaynak,$m);
- preg_match_all("@<link>(.*?)</link>@",$kaynak,$m2);
- if($m[1][0]=="1"){
- $a = $this->db->gir("update ayarlar set oyun='".$m2[1][0]."' where id='1'");
- return base64_decode(str_replace("&","",$m2[1][0]));
- }else{
- if($m[1][0]=="0"){
- $this->db->gir("update ayarlar set oyun='' where id='1'");
- exit('<script language="Javascript">window.location.href="http://www.webmaster.tc/inforesimoyunscripti/lisanscek.php"</script>');
- }
- }
- }
- function fakesubdomain($adres,$sef){
- if($this->fakesubdomain!="0"){
- return str_replace("www.",$sef.".",$adres);
- }else{
- return $adres;
- }
- }
- function twitterlogin($array){
- $id = $array->id;
- $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where twitter='".$id."'","0","uye");
- if(!empty($sor[0]->id)){
- setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
- setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
- $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
- $durum = "1";
- }else{
- $kadi = $array->screen_name;
- $adsoyad = $array->name;
- $kadi = $this->kadiata($adsoyad,"0");
- $sef = $this->arac->seola($kadi);
- $cinsiyet = "1";
- $resim = str_replace("_normal","",$array->profile_image_url_https);
- $urluzanti = $this->arac->uzantibul($resim);
- if($urluzanti=="jpg" or $urluzanti=="png" or $urluzanti=="gif" or $urluzanti=="jpeg"){
- $resim = $this->arac->urlcek($resim,"thumb",$sef);
- }
- $hakkinda = $array->status->text;
- $twitter = $id;
- $ip = $_SERVER['REMOTE_ADDR'];
- $sifre = md5(md5(md5(md5(time()."".rand(1,9)))));
- $ekle = $this->db->gir("insert into uyeler (kadi,sef,mail,sifre,adsoyad,cinsiyet,dogum,resim,hakkinda,tarih,songiristarih,ip,ip2,twitter) values ('$kadi','$sef','$mail','$sifre','$adsoyad','$cinsiyet','$dogum','$resim','$hakkinda',Now(),Now(),'$ip','$ip','$twitter')");
- $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where twitter='".$twitter."'","0","uye");
- setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
- setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
- $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
- $durum = "1";
- $this->arac->cachesil("uye");
- }
- return $durum;
- }
- function facebookislem($a=null){
- if($this->facebooklogin->getUser() and $_COOKIE["giris"]==""){
- $this->fblogin($this->facebooklogin->api('/' . $this->facebooklogin->getUser()),$this->facebooklogin->getUser());
- }
- }
- function kadiata($kadi,$sayi){
- if($sayi=="0"){
- $kadi2 = $kadi;
- }else{
- $kadi2 = $kadi."".$sayi;
- }
- $sor = $this->db->sorgu("select id from uyeler where kadi='".$kadi2."'","0","oyun");
- if(!empty($sor[0]->id)){
- $sayi = $sayi+1;
- return $this->kadiata($kadi,$sayi);
- }else{
- return $kadi2;
- }
- }
- function get_web_page($url, $ref = NULL)
- {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- $x = curl_exec($ch);
- curl_close($ch);
- preg_match('~Location: (.*)~', $x, $loc);
- return trim($loc[1]);
- }
- function fblogin($array,$id){
- $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where fb='".$id."'","0","uye");
- if(!empty($sor[0]->id)){
- setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
- setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
- $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
- $durum = "1";
- }else{
- $kadi = $array["username"];
- $adsoyad = $array["name"];
- $kadi = $this->kadiata($adsoyad,"0");
- $sef = $this->arac->seola($kadi);
- $mail = $array["email"];
- $cinsiyet = str_replace("male","1",$array["gender"]);
- $cinsiyet = str_replace("female","1",$cinsiyet);
- $dogum = $array["birthday"]."/1/1";
- preg_match_all("@(.*?)/(.*?)/(.*?)/(.*?)@",$dogum,$m);
- $dogum = $m[3][0]."/".$m[1][0]."/".$m[2][0];
- $resim = "http://graph.facebook.com/".$id."/picture?type=large";
- $resim = $this->get_web_page($resim);
- $resim = $this->arac->urlcek($resim,"thumb",$sef,"200","200");
- $hakkinda = $array["quotes"];
- $fb = $id;
- $ip = $_SERVER['REMOTE_ADDR'];
- $sifre = md5(md5(md5(md5(time()."".rand(1,9)))));
- $ekle = $this->db->gir("insert into uyeler (kadi,sef,mail,sifre,adsoyad,cinsiyet,dogum,resim,hakkinda,tarih,songiristarih,ip,ip2,fb) values ('$kadi','$sef','$mail','$sifre','$adsoyad','$cinsiyet','$dogum','$resim','$hakkinda',Now(),Now(),'$ip','$ip','$fb')");
- $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where fb='".$fb."'","0","uye");
- setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
- setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
- $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
- $durum = "1";
- $this->arac->cachesil("uye");
- }
- }
- function uyeekle($kadi,$mail,$sifre,$ad,$soyad,$cinsiyet,$dogum,$resim,$hakkinda){
- $sef = $this->arac->seola($kadi);
- $sor = $this->db->sorgu("select id from uyeler where kadi='$kadi'","0","oyun");
- if(!empty($sor[0]->id)){
- $ekle = "3";
- }else{
- $sor = $this->db->sorgu("select id from uyeler where mail='$mail'","0","oyun");
- if(!empty($sor[0]->id)){
- $ekle = "4";
- }else{
- $adsoyad = $ad." ".$soyad;
- $sifre = md5(md5(md5(md5($sifre))));
- if(!strstr($resim["url"], "Resim i") and $resim["url"]!=""){
- $urluzanti = $this->arac->uzantibul($resim["url"]);
- if($urluzanti=="jpg" or $urluzanti=="png" or $urluzanti=="gif" or $urluzanti=="jpeg"){
- $resimx = $this->arac->urlcek($resim["url"],"thumb",$sef);
- }
- }else{
- if(!empty($resim["bilgad"])){
- $dosyauzanti = $this->arac->uzantibul($resim["bilgad"]);
- if($dosyauzanti=="jpg" or $dosyauzanti=="png" or $dosyauzanti=="gif" or $dosyauzanti=="jpeg"){
- $resimx = $this->arac->bilgcek($resim["dosya"],"thumb",$sef,$dosyauzanti);
- }
- }
- }
- if(empty($resimx)){
- if($cinsiyet=="1"){
- $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/erkek.png";
- }else{
- $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/bayan.png";
- }
- }
- $ip = $_SERVER['REMOTE_ADDR'];
- $ekle = $this->db->gir("insert into uyeler (kadi,sef,mail,sifre,adsoyad,cinsiyet,dogum,resim,hakkinda,tarih,songiristarih,ip,ip2) values ('$kadi','$sef','$mail','$sifre','$adsoyad','$cinsiyet','$dogum','$resimx','$hakkinda',Now(),Now(),'$ip','$ip')");
- }
- }
- $this->arac->cachesil("uye");
- return $ekle;
- }
- function uyeguncelleadmin($kadi,$sifre,$mail,$adsoyad,$cinsiyet,$dogum,$resim,$hakkinda,$admin,$idms){
- $sef = $this->arac->seola($kadi);
- $sor = $this->db->sorgu("select id from uyeler where kadi='".$kadi."' and id!='".$idms."'","0","oyun");
- if(!empty($sor[0]->id)){
- $ekle = "3";
- }else{
- $sor = $this->db->sorgu("select id from uyeler where mail='".$mail."' and id!='".$idms."'","0","oyun");
- if(!empty($sor[0]->id)){
- $ekle = "4";
- }else{
- if(!empty($sifre)){
- $sifre = md5(md5(md5(md5($sifre))));
- }
- if(empty($resim)){
- if($cinsiyet=="1"){
- $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/erkek.png";
- }else{
- $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/bayan.png";
- }
- }
- $ip = $_SERVER['REMOTE_ADDR'];
- if(!empty($sifre)){
- $ekle = $this->db->gir("update uyeler set kadi='$kadi', sef='$sef', mail='$mail', sifre='$sifre', adsoyad='$adsoyad', cinsiyet='$cinsiyet', dogum='$dogum', resim='$resim', hakkinda='$hakkinda', admin='$admin' where id='$idms'");
- }else{
- $ekle = $this->db->gir("update uyeler set kadi='$kadi', sef='$sef', mail='$mail', adsoyad='$adsoyad', cinsiyet='$cinsiyet', dogum='$dogum', resim='$resim', hakkinda='$hakkinda', admin='$admin' where id='$idms'");
- }
- }
- }
- $this->arac->cachesil("uye");
- return $ekle;
- }
- .............................................................
- ..........................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement