Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2013
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.17 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. function temiz( $degisken )
  5. {
  6. $degisken = str_replace( "&", "", $degisken );
  7. $degisken = str_replace( "&#039;", " ", $degisken );
  8. $degisken = str_replace( " ", " ", $degisken );
  9. $degisken = str_replace( " ", " ", $degisken );
  10. return $degisken;
  11. }
  12.  
  13. function seola( $baslik )
  14. {
  15. $bul = array( "Ç", "Ş", "Ğ", "Ü", "İ", "Ö", "ç", "ş", "ğ", "ü", "ö", "ı", "-" );
  16. $yap = array( "c", "s", "g", "u", "i", "o", "c", "s", "g", "u", "o", "i", " " );
  17. $perma = strtolower( str_replace( $bul, $yap, $baslik ) );
  18. $find = array( " ", "&quot;", "&amp;", "&", "\\r\\n", "\\n", "/", "\\", "+", "<", ">" );
  19. $url = str_replace( $find, "-", $perma );
  20. $find = array( "é", "è", "ë", "ê", "É", "È", "Ë", "Ê" );
  21. $url = str_replace( $find, "e", $url );
  22. $find = array( "í", "ì", "î", "ï", "I", "Í", "Ì", "Î", "Ï" );
  23. $url = str_replace( $find, "i", $url );
  24. $find = array( "ó", "ö", "Ö", "ò", "ô", "Ó", "Ò", "Ô" );
  25. $url = str_replace( $find, "o", $url );
  26. $find = array( "á", "ä", "â", "à", "â", "Ä", "Â", "Á", "À", "Â" );
  27. $url = str_replace( $find, "a", $url );
  28. $find = array( "ú", "ü", "Ü", "ù", "û", "Ú", "Ù", "Û" );
  29. $url = str_replace( $find, "u", $url );
  30. $find = array( "ç", "Ç" );
  31. $url = str_replace( $find, "c", $url );
  32. $find = array( "?", "!", "\$", "#", "+" );
  33. $perma = str_replace( $find, "-", $url );
  34. $perma = preg_replace( "@[^A-Za-z0-9\\-]@i", " ", $perma );
  35. $perma = trim( preg_replace( "/\\s+/", " ", $perma ) );
  36. $perma = str_replace( " ", "-", $perma );
  37. $perma = str_replace( "--", "-", $perma );
  38. $perma = str_replace( "{$perma}", "{$perma}@", $perma );
  39. $perma = str_replace( "-@", "", $perma );
  40. $perma = str_replace( "@", "", $perma );
  41. return $perma;
  42. }
  43.  
  44. function clearmethod( $mVar )
  45. {
  46. if ( is_array( $mVar ) )
  47. {
  48. foreach ( $mVar as $gVal => $gVar )
  49. {
  50. if ( !is_array( $gVar ) )
  51. {
  52. $mVar[$gVal] = htmlspecialchars( strip_tags( urldecode( mysql_escape_string( addslashes( stripslashes( stripslashes( trim( htmlspecialchars_decode( $gVar ) ) ) ) ) ) ) ) );
  53. }
  54. else
  55. {
  56. $mVar[$gVal] = clearmethod( $gVar );
  57. }
  58. }
  59. }
  60. else
  61. {
  62. $mVar = htmlspecialchars( strip_tags( urldecode( mysql_escape_string( addslashes( stripslashes( stripslashes( trim( htmlspecialchars_decode( $mVar ) ) ) ) ) ) ) ) );
  63. }
  64. return $mVar;
  65. }
  66.  
  67. function arindir( $degisken )
  68. {
  69. $degisken = str_replace( "\\", "", $degisken );
  70. return $degisken;
  71. }
  72.  
  73. function sosyalag( $icerik )
  74. {
  75. }
  76.  
  77. function resample( $resim, $son_en, $son_boy )
  78. {
  79. ob_start( );
  80. $boyut = getimagesize( $resim );
  81. $en = $boyut[0];
  82. $boy = $boyut[1];
  83. $eski = imagecreatefromjpeg( $resim );
  84. $yeni = imagecreatetruecolor( $son_en, $son_boy );
  85. imagecopyresampled( $yeni, $eski, 0, 0, 0, 0, $son_en, $son_boy, $en, $boy );
  86. imagejpeg( $yeni, null, 0 - 1 );
  87. $icerik = ob_get_contents( );
  88. ob_end_clean( );
  89. imagedestroy( $eski );
  90. imagedestroy( $yeni );
  91. return $icerik;
  92. }
  93.  
  94. function uzantibul( $isim )
  95. {
  96. $dizi = explode( ".", $isim );
  97. $eleman = count( $dizi ) - 1;
  98. $uzanti = $dizi["{$eleman}"];
  99. return $uzanti;
  100. }
  101.  
  102. function tazele( $ali = "" )
  103. {
  104. $anadizin = $_SERVER['DOCUMENT_ROOT']."/cache";
  105. while ( !( $kaynak = opendir( $anadizin ) ) || !( false != ( $file = readdir( $kaynak ) ) ) )
  106. {
  107. if ( $file != "." && $file != ".." && file != ".htaccess" )
  108. {
  109. unlink( $anadizin."/".$file );
  110. }
  111. }
  112. }
  113.  
  114. function mysqlopt( $ali = "" )
  115. {
  116. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE alanlar" ) );
  117. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE ayarlar" ) );
  118. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE etiketler" ) );
  119. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE iletisim" ) );
  120. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE kategoriler" ) );
  121. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE player" ) );
  122. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE sansur" ) );
  123. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE sefyapi" ) );
  124. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE user" ) );
  125. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE videolar" ) );
  126. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE yorumbotu" ) );
  127. $uyarla = mysql_fetch_object( mysql_query( "REPAIR TABLE yorumlar" ) );
  128. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE alanlar" ) );
  129. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE ayarlar" ) );
  130. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE etiketler" ) );
  131. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE iletisim" ) );
  132. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE kategoriler" ) );
  133. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE player" ) );
  134. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE sansur" ) );
  135. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE sefyapi" ) );
  136. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE user" ) );
  137. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE videolar" ) );
  138. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE yorumbotu" ) );
  139. $uyarla = mysql_fetch_object( mysql_query( "OPTIMIZE TABLE yorumlar" ) );
  140. }
  141.  
  142. function sefe( $baslik )
  143. {
  144. $bul = array( "Ç", "Ş", "Ğ", "Ü", "İ", "Ö", "ç", "ş", "ğ", "ü", "ö", "ı", "-" );
  145. $yap = array( "c", "s", "g", "u", "i", "o", "c", "s", "g", "u", "o", "i", " " );
  146. $perma = strtolower( str_replace( $bul, $yap, $baslik ) );
  147. $find = array( " ", "&quot;", "&amp;", "&", "\\r\\n", "\\n", "/", "\\", "+", "<", ">" );
  148. $url = str_replace( $find, "-", $perma );
  149. $find = array( "é", "è", "ë", "ê", "É", "È", "Ë", "Ê" );
  150. $url = str_replace( $find, "e", $url );
  151. $find = array( "í", "ì", "î", "ï", "I", "Í", "Ì", "Î", "Ï" );
  152. $url = str_replace( $find, "i", $url );
  153. $find = array( "ó", "ö", "Ö", "ò", "ô", "Ó", "Ò", "Ô" );
  154. $url = str_replace( $find, "o", $url );
  155. $find = array( "á", "ä", "â", "à", "â", "Ä", "Â", "Á", "À", "Â" );
  156. $url = str_replace( $find, "a", $url );
  157. $find = array( "ú", "ü", "Ü", "ù", "û", "Ú", "Ù", "Û" );
  158. $url = str_replace( $find, "u", $url );
  159. $find = array( "ç", "Ç" );
  160. $url = str_replace( $find, "c", $url );
  161. $find = array( "?", "!", "\$", "#", "+" );
  162. $perma = str_replace( $find, "-", $url );
  163. $perma = preg_replace( "@[^A-Za-z0-9\\-]@i", " ", $perma );
  164. $perma = trim( preg_replace( "/\\s+/", " ", $perma ) );
  165. $perma = str_replace( " ", "-", $perma );
  166. $perma = str_replace( "--", "-", $perma );
  167. $perma = str_replace( "--", "-", $perma );
  168. $perma = str_replace( "{$perma}", "{$perma}@", $perma );
  169. $perma = str_replace( "-@", "", $perma );
  170. $perma = str_replace( "@", "", $perma );
  171. return $perma;
  172. }
  173.  
  174. function sef( $baslik )
  175. {
  176. $bul = array( "Ç", "Ş", "Ğ", "Ü", "İ", "Ö", "ç", "ş", "ğ", "ü", "ö", "ı", "-" );
  177. $yap = array( "c", "s", "g", "u", "i", "o", "c", "s", "g", "u", "o", "i", " " );
  178. $perma = strtolower( str_replace( $bul, $yap, $baslik ) );
  179. $find = array( " ", "&quot;", "&amp;", "&", "\\r\\n", "\\n", "/", "\\", "+", "<", ">" );
  180. $url = str_replace( $find, "-", $perma );
  181. $find = array( "é", "è", "ë", "ê", "É", "È", "Ë", "Ê" );
  182. $url = str_replace( $find, "e", $url );
  183. $find = array( "í", "ì", "î", "ï", "I", "Í", "Ì", "Î", "Ï" );
  184. $url = str_replace( $find, "i", $url );
  185. $find = array( "ó", "ö", "Ö", "ò", "ô", "Ó", "Ò", "Ô" );
  186. $url = str_replace( $find, "o", $url );
  187. $find = array( "á", "ä", "â", "à", "â", "Ä", "Â", "Á", "À", "Â" );
  188. $url = str_replace( $find, "a", $url );
  189. $find = array( "ú", "ü", "Ü", "ù", "û", "Ú", "Ù", "Û" );
  190. $url = str_replace( $find, "u", $url );
  191. $find = array( "ç", "Ç" );
  192. $url = str_replace( $find, "c", $url );
  193. $find = array( "?", "!", "\$", "#", "+" );
  194. $perma = str_replace( $find, "-", $url );
  195. $perma = preg_replace( "@[^A-Za-z0-9\\-]@i", " ", $perma );
  196. $perma = trim( preg_replace( "/\\s+/", " ", $perma ) );
  197. $perma = str_replace( " ", "-", $perma );
  198. $perma = str_replace( "--", "-", $perma );
  199. $perma = str_replace( "--", "-", $perma );
  200. $perma = str_replace( "{$perma}", "{$perma}@", $perma );
  201. $perma = str_replace( "-@", "", $perma );
  202. $perma = str_replace( "@", "", $perma );
  203. $bilgi = mysql_query( "select id from videolar where baslik='{$baslik}'" );
  204. $mevcut = mysql_num_rows( $bilgi );
  205. if ( $mevcut == "0" )
  206. {
  207. $perma = $perma;
  208. }
  209. else
  210. {
  211. $mevcut1 = $mevcut + 1;
  212. $perma = $perma."-".$mevcut1."";
  213. }
  214. return $perma;
  215. }
  216.  
  217. function query( $baslik, $title, $description, $keyword, $video, $aciklama, $resim, $etiket, $izlenme, $kategori, $sure )
  218. {
  219. if ( $izlenme == "" )
  220. {
  221. $izlenme = "0";
  222. }
  223. $baslik = addslashes( trim( $baslik ) );
  224. $aciklama = addslashes( trim( $aciklama ) );
  225. $etiket = addslashes( trim( $etiket ) );
  226. $video = addslashes( trim( $video ) );
  227. $title = addslashes( trim( $title ) );
  228. $description = addslashes( trim( $description ) );
  229. $keyword = addslashes( trim( $keyword ) );
  230. $bul = array( "Ç", "Ş", "Ğ", "Ü", "İ", "Ö", "ç", "ş", "ğ", "ü", "ö", "ı", "-" );
  231. $yap = array( "c", "s", "g", "u", "i", "o", "c", "s", "g", "u", "o", "i", " " );
  232. $perma = strtolower( str_replace( $bul, $yap, $baslik ) );
  233. $find = array( " ", "&quot;", "&amp;", "&", "\\r\\n", "\\n", "/", "\\", "+", "<", ">" );
  234. $url = str_replace( $find, "-", $perma );
  235. $find = array( "é", "è", "ë", "ê", "É", "È", "Ë", "Ê" );
  236. $url = str_replace( $find, "e", $url );
  237. $find = array( "í", "ì", "î", "ï", "I", "Í", "Ì", "Î", "Ï" );
  238. $url = str_replace( $find, "i", $url );
  239. $find = array( "ó", "ö", "Ö", "ò", "ô", "Ó", "Ò", "Ô" );
  240. $url = str_replace( $find, "o", $url );
  241. $find = array( "á", "ä", "â", "à", "â", "Ä", "Â", "Á", "À", "Â" );
  242. $url = str_replace( $find, "a", $url );
  243. $find = array( "ú", "ü", "Ü", "ù", "û", "Ú", "Ù", "Û" );
  244. $url = str_replace( $find, "u", $url );
  245. $find = array( "ç", "Ç" );
  246. $url = str_replace( $find, "c", $url );
  247. $find = array( "?", "!", "\$", "#", "+" );
  248. $perma = str_replace( $find, "-", $url );
  249. $perma = preg_replace( "@[^A-Za-z0-9\\-]@i", " ", $perma );
  250. $perma = trim( preg_replace( "/\\s+/", " ", $perma ) );
  251. $perma = str_replace( $find, "-", $perma );
  252. $perma = str_replace( " ", "-", $perma );
  253. $perma = str_replace( "--", "-", $perma );
  254. $perma = str_replace( "--", "-", $perma );
  255. $perma = str_replace( "--", "-", $perma );
  256. $perma = str_replace( "{$perma}", "{$perma}@", $perma );
  257. $perma = str_replace( "-@", "", $perma );
  258. $perma = str_replace( "@", "", $perma );
  259. $bilgi = mysql_query( "select id from videolar where baslik='{$baslik}'" );
  260. $mevcut = mysql_num_rows( $bilgi );
  261. $row = mysql_fetch_array( mysql_query( "SELECT videosefyapi FROM sefyapi WHERE id='1'" ) );
  262. $videosefyapi = $row['videosefyapi'];
  263. $row = mysql_fetch_array( mysql_query( "SELECT sef FROM kategoriler where id='{$kategori}'" ) );
  264. $kategorisef = $row['sef'];
  265. if ( $mevcut == "0" )
  266. {
  267. $perma = $perma;
  268. }
  269. else
  270. {
  271. $mevcut1 = $mevcut + 1;
  272. $perma = $perma."-".$mevcut1."";
  273. }
  274. $perma2 = str_replace( "\$baslik", "{$perma}", $videosefyapi );
  275. $perma2 = str_replace( "\$kategori", "{$kategorisef}", $perma2 );
  276. $listele = explode( ",", $etiket );
  277. $saybakam = count( $listele ) - 1;
  278. $sayac = 0;
  279. while ( $sayac <= $saybakam )
  280. {
  281. $kelime = trim( $listele[$sayac] );
  282. if ( $kelime != "" )
  283. {
  284. $permax = strtolower( str_replace( $bul, $yap, $kelime ) );
  285. $permax = preg_replace( "@[^A-Za-z0-9\\-]@i", " ", $permax );
  286. $permax = trim( preg_replace( "/\\s+/", " ", $permax ) );
  287. $permax = str_replace( " ", "-", $permax );
  288. $permax = str_replace( "--", "-", $permax );
  289. $permax = str_replace( "--", "-", $permax );
  290. $kelimex = $permax;
  291. $Sor = mysql_query( "SELECT * FROM etiketler WHERE sef='{$kelimex}'" );
  292. if ( @( mysql_num_rows( @$Sor ) < 1 ) )
  293. {
  294. mysql_query( "Insert Into etiketler (baslik,sef,durum) values ('{$kelime}','{$kelimex}','1')" );
  295. }
  296. }
  297. ++$sayac;
  298. }
  299. $sql = mysql_query( "insert into videolar (baslik,title,description,keyword,sef,sef2,video,aciklama,resim,etiket,izlenme,kategori,sure,tarih) values ('{$baslik}','{$title}','{$description}','{$keyword}','{$perma}','{$perma2}','{$video}','{$aciklama}','{$resim}','{$etiket}','{$izlenme}','{$kategori}','{$sure}',Now())" );
  300. if ( $sql )
  301. {
  302. $row = mysql_fetch_array( mysql_query( "SELECT id FROM videolar WHERE sef2='{$perma2}'" ) );
  303. $id = $row['id'];
  304. $perma2 = str_replace( "\$id", "{$id}", $perma2 );
  305. $sonuc = mysql_query( "update videolar set sef2='{$perma2}' where id='{$id}'" );
  306. return "Video başarıyla eklendi !";
  307. }
  308. return "Video eklenemedi !";
  309. }
  310.  
  311. function lisanskontrol( $site_lisans )
  312. {
  313. if ( substr( getenv( "HTTP_HOST" ), 0, 4 ) == "www." )
  314. {
  315. $domainadi = substr( getenv( "HTTP_HOST" ), 4 );
  316. }
  317. else
  318. {
  319. $domainadi = getenv( "HTTP_HOST" );
  320. }
  321. $lisans = $_REQUEST['kontrol'];
  322. if ( !function_exists( "curl_init" ) )
  323. {
  324. exit( "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\r\n<strong><center>Sunucunuzda Curl Fonksiyonu Bulunmamaktadır. Lütfen Hosting Sahibiniz ile İletişime Geçip Yükletin.</strong></center>" );
  325. }
  326. @$row = @mysql_fetch_array( @mysql_query( "SELECT inforesim FROM ayarlar WHERE id='1'" ) );
  327. $inforesimx = $row['inforesim'];
  328. if ( $inforesimx != "1" )
  329. {
  330. $lisans = "lisans";
  331. $row = mysql_query( "ALTER TABLE `ayarlar` DROP `inforesim`" );
  332. }
  333. if ( $lisans != "" )
  334. {
  335. $ch = curl_init( );
  336. $timeout = 5;
  337. curl_setopt( $ch, CURLOPT_URL, "http://www.inforesim.com/lisansinf.php?domain=".$domainadi."&hash=".$site_lisans."" );
  338. curl_setopt( $ch, CURLOPT_HEADER, false );
  339. curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
  340. curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
  341. curl_setopt( $ch, CURLOPT_REFERER, "http://www.inforesim.com" );
  342. curl_setopt( $ch, CURLOPT_USERAGENT, "inforesimbot" );
  343. $inforesim = curl_exec( $ch );
  344. curl_close( $ch );
  345. }
  346. $site_hash = md5( md5( $domainadi."infoskvds12sd" ) );
  347. if ( $site_lisans == $site_hash )
  348. {
  349. if ( $inforesim != "" )
  350. {
  351. if ( $inforesim == "0" )
  352. {
  353. $row = mysql_query( "ALTER TABLE `ayarlar` DROP `inforesim`" );
  354. echo "\r\n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\r\n<strong><center>Lisanssız Yazılım Kullanıyorsunuz, Lütfen Lisans Alın ! Lisans İçin : <a href=\"http://www.inforesim.com\">http://www.inforesim.com</a></strong></center>";
  355. exit( );
  356. }
  357. if ( $inforesim == "1" && $inforesimx != "1" )
  358. {
  359. $row = mysql_query( "ALTER TABLE `ayarlar` DROP `inforesim`" );
  360. $row = mysql_query( "ALTER TABLE `ayarlar` ADD `inforesim` ENUM('1') NOT NULL" );
  361. exit( );
  362. }
  363. }
  364. }
  365. else
  366. {
  367. echo "\r\n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\r\n<strong><center>Lisanssız Yazılım Kullanıyorsunuz, Lütfen Lisans Alın ! Lisans İçin : <a href=\"http://www.inforesim.com\">http://www.inforesim.com</a></strong></center>";
  368. exit( );
  369. }
  370. }
  371.  
  372. lisanskontrol( $site_lisans );
  373. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement