Advertisement
Guest User

aaek

a guest
Jun 28th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.54 KB | None | 0 0
  1. <?php
  2.  
  3. function boslukTemizle($string) {
  4.     preg_replace( '/\s+/', ' ', $string );
  5.     $string = '';
  6.     trim( $string );
  7.     $string = '';
  8.     return $string;
  9. }
  10.  
  11. function zamanekLe() {
  12.     echo '<div id="zamanSonucu"><input type="text" name="tarih" id="basic_example_" value="' . date( 'Y-m-d H:i:s', strtotime( '+2 hour' ) ) . '" /><pre style=\'display:none;\'>$(\'#basic_example_\').datetimepicker({dateFormat: \'yy-mm-dd\',timeFormat: \'HH:mm:ss\',numberOfMonths: 2,});</pre></div>';
  13. function strposa($haystack, $needles=array(), $offset=0) {
  14.         $chr = array();
  15.         foreach($needles as $needle) {
  16.                 $res = strpos($haystack, $needle, $offset);
  17.                 if ($res !== false) $chr[$needle] = $res;
  18.         }
  19.         if(empty($chr)) return false;
  20.         return min($chr);
  21. }
  22.  
  23. function sef($text) {
  24.     $degis = array( 'I', 'S', '-', 'U', 'C', 'G', 'O', 'i', 's', 'u', 'c', 'g', 'o' );
  25.     $text = $bul = array( 'İ', 'Ş', ' ', 'Ü', 'Ç', 'Ğ', 'Ö', 'ı', 'ş', 'ü', 'ç', 'ğ', 'ö' );
  26.     preg_replace( '@[^A-Za-z0-9\-_]+@i', '', $text );
  27.     $text = '';
  28.     strtolower( $text );
  29.     $text = str_ireplace( $bul, $degis, $text );
  30.     return $text;
  31. }
  32.  
  33. function kategorigoster() {
  34.     mysql_query( 'select * from wp_term_taxonomy where taxonomy=\'category\'' );
  35.     $get = '';
  36.     mysql_fetch_array( $get );
  37.  
  38.     if ($gelis ) {
  39.         $gelis['term_id'];
  40.         $idsm = '';
  41.         mysql_query( '' . 'select * from wp_terms where term_id=\'' . $idsm . '\'' );
  42.         $adbul = '';
  43.         mysql_fetch_array( $adbul );
  44.         $oks = '';
  45.         $oks['name'];
  46.         $neymis = '';
  47.         echo '<option value="' . $idsm . '">' . $neymis . '</option>';
  48.     }
  49.  
  50. }
  51.  
  52. function kategoricheck() {
  53.     global $wpdb;
  54.  
  55.     mysql_query( '' . 'SELECT * FROM ' . $wpdb->terms . ' WHERE term_id IN (SELECT term_id FROM ' . $wpdb->term_taxonomy . ' WHERE taxonomy = \'category\') ORDER BY name' );
  56.     $sorgu = '';
  57.     mysql_fetch_array( $sorgu );
  58.  
  59.     if ($veri ) {
  60.         echo '<div class="ktx"><input type="checkbox" style="width:16px;" name="kategori[]" value="' . $veri['term_id'] . '"> ' . $veri['name'] . '</div>';
  61.     }
  62.  
  63. }
  64.  
  65. function yazp($a) {
  66.     echo '<pre>';
  67.     print_r( $a );
  68.     echo '</pre>';
  69. }
  70.  
  71. function selectediS($i, $b) {
  72.     return ($i == $b ? ' selected="selected" ' : '');
  73. }
  74.  
  75. function kodTemizle2($yazi) {
  76.     $yazi = preg_replace( '\'<script[^>]*>.*?</script>\'si', '', $yazi );
  77.     $yazi = preg_replace( '\'<input[^>]*>.*?/>\'si', '', $yazi );
  78.     $yazi = preg_replace( '\'<div[^>]*>\'si', '', $yazi );
  79.     $yazi = preg_replace( '\'<table[^>]*>.*?</table>\'si', '', $yazi );
  80.     $yazi = str_replace( '</div>', '', $yazi );
  81.     return $yazi;
  82. }
  83.  
  84. function ResimCek($Icerik_ID, $Resim) {
  85.     filmF( filmQ( '' . 'SELECT post_title FROM wp_posts WHERE ID = \'' . $Icerik_ID . '\'' ) );
  86.     SefUrl( $Baslik['post_title'] );
  87.     $DosyaninAdi = '';
  88.     wp_upload_dir(  );
  89.     $Upload_Dizin = '';
  90.     @file_get_contents( $Resim );
  91.     explode( '.', $Resim );
  92.     $DosyaUzantisi = '';
  93.     end( $DosyaUzantisi );
  94.     $DosyaAdi = $DosyaninAdi . '.' . $DosyaUzantisi;
  95.  
  96.     if (wp_mkdir_p( $Upload_Dizin['path'] )) {
  97.         $Dosya = $Upload_Dizin['path'] . '/' . $DosyaAdi;
  98.     }
  99.     else {
  100.         $Dosya = $Upload_Dizin['basedir'] . '/' . $DosyaAdi;
  101.     }
  102.  
  103.     file_put_contents( $Dosya, $ResimVerisi );
  104.     wp_check_filetype( $DosyaAdi, null );
  105.     $DosyaTipi = $Baslik = '';
  106.     $Eklenti = array( 'post_mime_type' => $DosyaTipi['type'], 'post_title' => sanitize_file_name( $DosyaAdi ), 'post_content' => '', 'post_status' => 'inherit' );
  107.     wp_insert_attachment( $Eklenti, $Dosya, $Icerik_ID );
  108.     $GorselID = $ResimVerisi = '';
  109.     require_once( ABSPATH . 'wp-admin/includes/image.php' );
  110.     wp_generate_attachment_metadata( $GorselID, $Dosya );
  111.     $EklentiVerisi = $DosyaUzantisi = '';
  112.     wp_update_attachment_metadata( $GorselID, $EklentiVerisi );
  113.     set_post_thumbnail( $Icerik_ID, $GorselID );
  114.     return $Upload_Dizin['url'] . '/' . $DosyaAdi;
  115. }
  116.  
  117. function baglan($url) {
  118.     curl_init(  );
  119.     $curl = '';
  120.     $header[0] = 'Accept: text/xml,application/xml,application/xhtml+xml,';
  121.     $header[1] = 'text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
  122.     $header[2] = 'Cache-Control: max-age=0';
  123.     $header[3] = 'Connection: keep-alive';
  124.     $header[4] = 'Keep-Alive: 300';
  125.     $header[5] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
  126.     $header[6] = 'Accept-Language: en-us,en;q=0.5';
  127.     $header[7] = 'Pragma: ';
  128.     curl_setopt( $curl, CURLOPT_URL, $url );
  129.     curl_setopt( $curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)' );
  130.     curl_setopt( $curl, CURLOPT_HTTPHEADER, $header );
  131.     curl_setopt( $curl, CURLOPT_REFERER, 'http://www.google.com' );
  132.     curl_setopt( $curl, CURLOPT_HEADER, 1 );
  133.     curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, false );
  134.     curl_setopt( $curl, CURLOPT_MAXREDIRS, 10 );
  135.     curl_setopt( $curl, CURLOPT_ENCODING, 'gzip,deflate' );
  136.     curl_setopt( $curl, CURLOPT_AUTOREFERER, true );
  137.     curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
  138.     curl_setopt( $curl, CURLOPT_TIMEOUT, 30 );
  139.     curl_exec( $curl );
  140.     $html = '';
  141.     curl_close( $curl );
  142.     return $html;
  143. }
  144.  
  145. function SefUrl($Veri) {
  146.     str_replace( 'ç', 'c', trim( $Veri ) );
  147.     $Veri = '';
  148.     str_replace( 'Ç', 'C', $Veri );
  149.     $Veri = '';
  150.     str_replace( 'Ğ', 'G', $Veri );
  151.     $Veri = '';
  152.     str_replace( 'ğ', 'g', $Veri );
  153.     $Veri = '';
  154.     str_replace( 'İ', 'I', $Veri );
  155.     $Veri = '';
  156.     str_replace( 'ı', 'i', $Veri );
  157.     $Veri = '';
  158.     str_replace( 'ş', 's', $Veri );
  159.     $Veri = '';
  160.     str_replace( 'Ş', 'S', $Veri );
  161.     $Veri = '';
  162.     str_replace( 'Ö', 'O', $Veri );
  163.     $Veri = '';
  164.     str_replace( 'ö', 'o', $Veri );
  165.     $Veri = '';
  166.     str_replace( 'Ü', 'U', $Veri );
  167.     $Veri = '';
  168.     str_replace( 'ü', 'u', $Veri );
  169.     $Veri = '';
  170.     strtolower( $Veri );
  171.     $Veri = '';
  172.     $ara = array( '&nbsp', '&amp', '&quot;', '<', '>', '&#39', '&#92' );
  173.     str_replace( $ara, '', $Veri );
  174.     $Veri = '';
  175.     $ara = "array( ' ', '(', ')', '\'', '?', 'http://', '&', '\r\n', '\n', '/', '\', '+' )";
  176.         str_replace( $ara, '-', $Veri );
  177.         $Veri = '';
  178.         $ara = array( '/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/' );
  179.         $degistir = array( '', '-', '' );
  180.         preg_replace( $ara, $degistir, $Veri );
  181.         $Veri = '';
  182.         return $Veri;
  183.     }
  184.  
  185.     function filmR($a) {
  186.         if (get_magic_quotes_gpc(  )) {
  187.             return $a;
  188.         }
  189.  
  190.         return mysql_real_escape_string( $a );
  191.     }
  192.  
  193.     function filmG($Adi) {
  194.         return filmR( $_GET[$Adi] );
  195.     }
  196.  
  197.     function filmP($Adi) {
  198.         return filmR( $_POST[$Adi] );
  199.     }
  200.  
  201.     function filmQ($Gelen) {
  202.         return mysql_query( $Gelen );
  203.     }
  204.  
  205.     function filmF($Gelen) {
  206.         return mysql_fetch_array( $Gelen );
  207.     }
  208.  
  209.     function filmVarmi($Baslik) {
  210.         filmF( filmQ( 'SELECT COUNT(ID) AS Toplam FROM wp_posts WHERE post_title = \'' . filmR( $Baslik ) . '\'' ) );
  211. $Varmi = '';
  212. return $Varmi['Toplam'];
  213. }
  214.  
  215. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement