Advertisement
Guest User

Untitled

a guest
Mar 28th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.07 KB | None | 0 0
  1. <?php
  2. include($_SERVER["DOCUMENT_ROOT"]."/class/facebook/facebook.php");
  3. include($_SERVER["DOCUMENT_ROOT"]."/class/database.php");
  4. include($_SERVER["DOCUMENT_ROOT"]."/class/tools.php");
  5. include($_SERVER["DOCUMENT_ROOT"]."/class/sefyapi.php");
  6. include($_SERVER["DOCUMENT_ROOT"]."/class/metatag.php");
  7. ob_start();
  8. class Oyun{
  9. function __construct($vt_kullanici,$vt_parola,$vt_isim,$vt_sunucu,$vt_cache_sure){
  10. if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
  11. $domainadi = substr($_SERVER['HTTP_HOST'], 3);
  12. } else {
  13. $domainadi = str_replace(array_shift(explode(".",getenv("HTTP_HOST"))),"",$_SERVER['HTTP_HOST']);
  14. }
  15. $this->alanadi = $domainadi;
  16. $this->db = new AlpSQL($vt_isim,$vt_kullanici,$vt_parola,$vt_sunucu,$vt_cache_sure);
  17. $this->arac = new AlpTools;
  18. $this->swfayar = $this->db->sorgu("select oyunswf from ayarlar where id='1'","1","ayarlar");
  19. $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");
  20. $connectislem = $this->db->sorgu("select fblogin,fbappid,fbsecretid,fakesubdomain,oyun from ayarlar where id='1'","0","uye");
  21. $this->oyunum = $connectislem[0]->oyun;
  22. $this->fakesubdomain = $connectislem[0]->fakesubdomain;
  23. if(!empty($_GET["kontrol"])){
  24. $this->anakontrol();
  25. }
  26. $this->link();
  27. $this->facebooklogis = $connectislem[0]->fblogin;
  28. $this->sef = new AlpSefyapi($this->sefyapi,$connectislem[0]->fakesubdomain);
  29. $this->metatag = new AlpMetatag;
  30. if($connectislem[0]->fblogin=="1" and $_GET["ser"]!="" and $_COOKIE["giris"]==""){
  31. $this->fbappid = $connectislem[0]->fbappid;
  32. $this->facebooklogin = new Facebook(array('appId' => $connectislem[0]->fbappid,'secret' => $connectislem[0]->fbsecretid,'cookie' => true,));
  33. $this->facebookislem();
  34. }
  35. }
  36. function clearMethod($mVar){
  37. if(is_array($mVar)){
  38. foreach($mVar as $gVal => $gVar){
  39. if(!is_array($gVar)){
  40. $mVar[$gVal] = htmlspecialchars(strip_tags(urldecode(mysql_escape_string(addslashes(stripslashes(stripslashes(trim(htmlspecialchars_decode($gVar)))))))));
  41. }else{
  42. $mVar[$gVal] = $this->clearMethod($gVar);
  43. }
  44. }
  45. }else{
  46. $mVar = htmlspecialchars(strip_tags(urldecode(mysql_escape_string(addslashes(stripslashes(stripslashes(trim(htmlspecialchars_decode($mVar)))))))));
  47. }
  48. return $mVar;
  49. }
  50.  
  51. function canonical($veri,$adres){
  52. $adres = $adres."/x/x";
  53. $son = substr($veri, -1);
  54. preg_match_all("@".$this->sefyapi[0]->sayfaek."/(.*?)/(.*?)@",$adres,$m);
  55. if(empty($m[1][0])){
  56. $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
  57. }else{
  58. if($son=="/"){
  59. $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
  60. $adres2 = str_replace($this->sefyapi[0]->sayfaek."/".$m[1][0],"",$adres2);
  61. }else{
  62. $adres2 = "http://".getenv('HTTP_HOST')."".$_SERVER['REQUEST_URI'];
  63. $adres2 = str_replace("/".$this->sefyapi[0]->sayfaek."/".$m[1][0],"",$adres2);
  64. }
  65. }
  66. return $adres2;
  67. }
  68.  
  69. function link(){
  70. $link = $this->oyunum;
  71. $link = str_replace("&","",$link);
  72. if(empty($link)){
  73. return $this->anakontrol();
  74. }else{
  75. $link = base64_decode($link);
  76. if(strstr($link, "href")){
  77. return $link;
  78. }else{
  79. return $this->anakontrol();
  80. }
  81. }
  82. }
  83.  
  84. function cekim($url,$timeout=null){
  85. $ch = curl_init();
  86. if(empty($timeout)){
  87. $timeout = "5";
  88. }
  89. curl_setopt($ch,CURLOPT_URL,$url);
  90. curl_setopt($ch,CURLOPT_HEADER,false);
  91. curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
  92. curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
  93. curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  94. curl_setopt($ch,CURLOPT_REFERER,"http://www.google.com.tr");
  95. curl_setopt($ch,CURLOPT_USERAGENT,"inforesimoyun");
  96. $data = curl_exec($ch);
  97. curl_close($ch);
  98. return $data;
  99. }
  100.  
  101. function anakontrol(){
  102. if($this->fakesubdomain=="1"){
  103. if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
  104. $domainadi = substr($_SERVER['HTTP_HOST'], 4);
  105. } else {
  106. $domainadi = str_replace(array_shift(explode(".",getenv("HTTP_HOST"))),"",$_SERVER['HTTP_HOST']);
  107. $domainadi = str_replace($domainadi,"@".$domainadi,$domainadi);
  108. $domainadi = str_replace("@.","",$domainadi);
  109. $domainadi = str_replace("@","",$domainadi);
  110. }
  111. }else{
  112. if (substr($_SERVER['HTTP_HOST'], 0, 4) == "www.") {
  113. $domainadi = substr($_SERVER['HTTP_HOST'], 4);
  114. } else {
  115. $domainadi = $_SERVER['HTTP_HOST'];
  116. }
  117. }
  118. $alanadim = $domainadi;
  119. $kaynak = $this->cekim("http://www.forumbornova.net/kontrol.php?x=".$alanadim);
  120. preg_match_all("@<durum>(.*?)</durum>@",$kaynak,$m);
  121. preg_match_all("@<link>(.*?)</link>@",$kaynak,$m2);
  122. if($m[1][0]=="1"){
  123. $a = $this->db->gir("update ayarlar set oyun='".$m2[1][0]."' where id='1'");
  124. return base64_decode(str_replace("&","",$m2[1][0]));
  125. }else{
  126. if($m[1][0]=="0"){
  127. $this->db->gir("update ayarlar set oyun='' where id='1'");
  128. exit('<script language="Javascript">window.location.href="http://www.webmaster.tc/inforesimoyunscripti/lisanscek.php"</script>');
  129. }
  130. }
  131.  
  132. }
  133.  
  134. function fakesubdomain($adres,$sef){
  135. if($this->fakesubdomain!="0"){
  136. return str_replace("www.",$sef.".",$adres);
  137. }else{
  138. return $adres;
  139. }
  140. }
  141.  
  142. function twitterlogin($array){
  143. $id = $array->id;
  144. $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where twitter='".$id."'","0","uye");
  145. if(!empty($sor[0]->id)){
  146. setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
  147. setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
  148. $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
  149. $durum = "1";
  150. }else{
  151. $kadi = $array->screen_name;
  152. $adsoyad = $array->name;
  153. $kadi = $this->kadiata($adsoyad,"0");
  154. $sef = $this->arac->seola($kadi);
  155. $cinsiyet = "1";
  156. $resim = str_replace("_normal","",$array->profile_image_url_https);
  157. $urluzanti = $this->arac->uzantibul($resim);
  158. if($urluzanti=="jpg" or $urluzanti=="png" or $urluzanti=="gif" or $urluzanti=="jpeg"){
  159. $resim = $this->arac->urlcek($resim,"thumb",$sef);
  160. }
  161. $hakkinda = $array->status->text;
  162. $twitter = $id;
  163. $ip = $_SERVER['REMOTE_ADDR'];
  164. $sifre = md5(md5(md5(md5(time()."".rand(1,9)))));
  165. $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')");
  166. $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where twitter='".$twitter."'","0","uye");
  167. setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
  168. setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
  169. $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
  170. $durum = "1";
  171. $this->arac->cachesil("uye");
  172. }
  173. return $durum;
  174. }
  175.  
  176. function facebookislem($a=null){
  177. if($this->facebooklogin->getUser() and $_COOKIE["giris"]==""){
  178. $this->fblogin($this->facebooklogin->api('/' . $this->facebooklogin->getUser()),$this->facebooklogin->getUser());
  179. }
  180. }
  181. function kadiata($kadi,$sayi){
  182. if($sayi=="0"){
  183. $kadi2 = $kadi;
  184. }else{
  185. $kadi2 = $kadi."".$sayi;
  186. }
  187. $sor = $this->db->sorgu("select id from uyeler where kadi='".$kadi2."'","0","oyun");
  188. if(!empty($sor[0]->id)){
  189. $sayi = $sayi+1;
  190. return $this->kadiata($kadi,$sayi);
  191.  
  192. }else{
  193. return $kadi2;
  194. }
  195. }
  196. function get_web_page($url, $ref = NULL)
  197. {
  198. $ch = curl_init();
  199. curl_setopt($ch, CURLOPT_URL, $url);
  200. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  201. curl_setopt($ch, CURLOPT_HEADER, 1);
  202. $x = curl_exec($ch);
  203. curl_close($ch);
  204. preg_match('~Location: (.*)~', $x, $loc);
  205. return trim($loc[1]);
  206. }
  207. function fblogin($array,$id){
  208. $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where fb='".$id."'","0","uye");
  209. if(!empty($sor[0]->id)){
  210. setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
  211. setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
  212. $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
  213. $durum = "1";
  214. }else{
  215. $kadi = $array["username"];
  216. $adsoyad = $array["name"];
  217. $kadi = $this->kadiata($adsoyad,"0");
  218. $sef = $this->arac->seola($kadi);
  219. $mail = $array["email"];
  220. $cinsiyet = str_replace("male","1",$array["gender"]);
  221. $cinsiyet = str_replace("female","1",$cinsiyet);
  222. $dogum = $array["birthday"]."/1/1";
  223. preg_match_all("@(.*?)/(.*?)/(.*?)/(.*?)@",$dogum,$m);
  224. $dogum = $m[3][0]."/".$m[1][0]."/".$m[2][0];
  225. $resim = "http://graph.facebook.com/".$id."/picture?type=large";
  226. $resim = $this->get_web_page($resim);
  227. $resim = $this->arac->urlcek($resim,"thumb",$sef,"200","200");
  228. $hakkinda = $array["quotes"];
  229. $fb = $id;
  230. $ip = $_SERVER['REMOTE_ADDR'];
  231. $sifre = md5(md5(md5(md5(time()."".rand(1,9)))));
  232. $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')");
  233. $sor = $this->db->sorgu("select id,kadi,sifre from uyeler where fb='".$fb."'","0","uye");
  234. setcookie("kadi",$sor[0]->kadi,time()+36000,"/",$this->alanadi);
  235. setcookie("giris",md5(md5(md5($sor[0]->kadi."-".$sor[0]->sifre."-".$_SERVER["REMOTE_ADDR"]))),time()+36000,"/",$this->alanadi);
  236. $this->db->gir("update uyeler set songiristarih=Now(), ip2='".$_SERVER["REMOTE_ADDR"]."' where id='".$sor[0]->id."'");
  237. $durum = "1";
  238. $this->arac->cachesil("uye");
  239. }
  240. }
  241. function uyeekle($kadi,$mail,$sifre,$ad,$soyad,$cinsiyet,$dogum,$resim,$hakkinda){
  242. $sef = $this->arac->seola($kadi);
  243. $sor = $this->db->sorgu("select id from uyeler where kadi='$kadi'","0","oyun");
  244. if(!empty($sor[0]->id)){
  245. $ekle = "3";
  246. }else{
  247. $sor = $this->db->sorgu("select id from uyeler where mail='$mail'","0","oyun");
  248. if(!empty($sor[0]->id)){
  249. $ekle = "4";
  250. }else{
  251. $adsoyad = $ad." ".$soyad;
  252. $sifre = md5(md5(md5(md5($sifre))));
  253. if(!strstr($resim["url"], "Resim i") and $resim["url"]!=""){
  254. $urluzanti = $this->arac->uzantibul($resim["url"]);
  255. if($urluzanti=="jpg" or $urluzanti=="png" or $urluzanti=="gif" or $urluzanti=="jpeg"){
  256. $resimx = $this->arac->urlcek($resim["url"],"thumb",$sef);
  257. }
  258. }else{
  259. if(!empty($resim["bilgad"])){
  260. $dosyauzanti = $this->arac->uzantibul($resim["bilgad"]);
  261. if($dosyauzanti=="jpg" or $dosyauzanti=="png" or $dosyauzanti=="gif" or $dosyauzanti=="jpeg"){
  262. $resimx = $this->arac->bilgcek($resim["dosya"],"thumb",$sef,$dosyauzanti);
  263. }
  264. }
  265. }
  266. if(empty($resimx)){
  267. if($cinsiyet=="1"){
  268. $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/erkek.png";
  269. }else{
  270. $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/bayan.png";
  271. }
  272. }
  273. $ip = $_SERVER['REMOTE_ADDR'];
  274. $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')");
  275. }
  276. }
  277. $this->arac->cachesil("uye");
  278. return $ekle;
  279. }
  280.  
  281. function uyeguncelleadmin($kadi,$sifre,$mail,$adsoyad,$cinsiyet,$dogum,$resim,$hakkinda,$admin,$idms){
  282. $sef = $this->arac->seola($kadi);
  283. $sor = $this->db->sorgu("select id from uyeler where kadi='".$kadi."' and id!='".$idms."'","0","oyun");
  284. if(!empty($sor[0]->id)){
  285. $ekle = "3";
  286. }else{
  287. $sor = $this->db->sorgu("select id from uyeler where mail='".$mail."' and id!='".$idms."'","0","oyun");
  288. if(!empty($sor[0]->id)){
  289. $ekle = "4";
  290. }else{
  291. if(!empty($sifre)){
  292. $sifre = md5(md5(md5(md5($sifre))));
  293. }
  294. if(empty($resim)){
  295. if($cinsiyet=="1"){
  296. $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/erkek.png";
  297. }else{
  298. $resimx = "http://".$_SERVER["HTTP_HOST"]."/sayfalar/bayan.png";
  299. }
  300. }
  301. $ip = $_SERVER['REMOTE_ADDR'];
  302. if(!empty($sifre)){
  303. $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'");
  304. }else{
  305. $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'");
  306. }
  307. }
  308. }
  309. $this->arac->cachesil("uye");
  310. return $ekle;
  311. }
  312. .............................................................
  313. ..........................
  314. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement