Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function boslukTemizle($string) {
- preg_replace( '/\s+/', ' ', $string );
- $string = '';
- trim( $string );
- $string = '';
- return $string;
- }
- function zamanekLe() {
- 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>';
- function strposa($haystack, $needles=array(), $offset=0) {
- $chr = array();
- foreach($needles as $needle) {
- $res = strpos($haystack, $needle, $offset);
- if ($res !== false) $chr[$needle] = $res;
- }
- if(empty($chr)) return false;
- return min($chr);
- }
- function sef($text) {
- $degis = array( 'I', 'S', '-', 'U', 'C', 'G', 'O', 'i', 's', 'u', 'c', 'g', 'o' );
- $text = $bul = array( 'İ', 'Ş', ' ', 'Ü', 'Ç', 'Ğ', 'Ö', 'ı', 'ş', 'ü', 'ç', 'ğ', 'ö' );
- preg_replace( '@[^A-Za-z0-9\-_]+@i', '', $text );
- $text = '';
- strtolower( $text );
- $text = str_ireplace( $bul, $degis, $text );
- return $text;
- }
- function kategorigoster() {
- mysql_query( 'select * from wp_term_taxonomy where taxonomy=\'category\'' );
- $get = '';
- mysql_fetch_array( $get );
- if ($gelis ) {
- $gelis['term_id'];
- $idsm = '';
- mysql_query( '' . 'select * from wp_terms where term_id=\'' . $idsm . '\'' );
- $adbul = '';
- mysql_fetch_array( $adbul );
- $oks = '';
- $oks['name'];
- $neymis = '';
- echo '<option value="' . $idsm . '">' . $neymis . '</option>';
- }
- }
- function kategoricheck() {
- global $wpdb;
- mysql_query( '' . 'SELECT * FROM ' . $wpdb->terms . ' WHERE term_id IN (SELECT term_id FROM ' . $wpdb->term_taxonomy . ' WHERE taxonomy = \'category\') ORDER BY name' );
- $sorgu = '';
- mysql_fetch_array( $sorgu );
- if ($veri ) {
- echo '<div class="ktx"><input type="checkbox" style="width:16px;" name="kategori[]" value="' . $veri['term_id'] . '"> ' . $veri['name'] . '</div>';
- }
- }
- function yazp($a) {
- echo '<pre>';
- print_r( $a );
- echo '</pre>';
- }
- function selectediS($i, $b) {
- return ($i == $b ? ' selected="selected" ' : '');
- }
- function kodTemizle2($yazi) {
- $yazi = preg_replace( '\'<script[^>]*>.*?</script>\'si', '', $yazi );
- $yazi = preg_replace( '\'<input[^>]*>.*?/>\'si', '', $yazi );
- $yazi = preg_replace( '\'<div[^>]*>\'si', '', $yazi );
- $yazi = preg_replace( '\'<table[^>]*>.*?</table>\'si', '', $yazi );
- $yazi = str_replace( '</div>', '', $yazi );
- return $yazi;
- }
- function ResimCek($Icerik_ID, $Resim) {
- filmF( filmQ( '' . 'SELECT post_title FROM wp_posts WHERE ID = \'' . $Icerik_ID . '\'' ) );
- SefUrl( $Baslik['post_title'] );
- $DosyaninAdi = '';
- wp_upload_dir( );
- $Upload_Dizin = '';
- @file_get_contents( $Resim );
- explode( '.', $Resim );
- $DosyaUzantisi = '';
- end( $DosyaUzantisi );
- $DosyaAdi = $DosyaninAdi . '.' . $DosyaUzantisi;
- if (wp_mkdir_p( $Upload_Dizin['path'] )) {
- $Dosya = $Upload_Dizin['path'] . '/' . $DosyaAdi;
- }
- else {
- $Dosya = $Upload_Dizin['basedir'] . '/' . $DosyaAdi;
- }
- file_put_contents( $Dosya, $ResimVerisi );
- wp_check_filetype( $DosyaAdi, null );
- $DosyaTipi = $Baslik = '';
- $Eklenti = array( 'post_mime_type' => $DosyaTipi['type'], 'post_title' => sanitize_file_name( $DosyaAdi ), 'post_content' => '', 'post_status' => 'inherit' );
- wp_insert_attachment( $Eklenti, $Dosya, $Icerik_ID );
- $GorselID = $ResimVerisi = '';
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
- wp_generate_attachment_metadata( $GorselID, $Dosya );
- $EklentiVerisi = $DosyaUzantisi = '';
- wp_update_attachment_metadata( $GorselID, $EklentiVerisi );
- set_post_thumbnail( $Icerik_ID, $GorselID );
- return $Upload_Dizin['url'] . '/' . $DosyaAdi;
- }
- function baglan($url) {
- curl_init( );
- $curl = '';
- $header[0] = 'Accept: text/xml,application/xml,application/xhtml+xml,';
- $header[1] = 'text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
- $header[2] = 'Cache-Control: max-age=0';
- $header[3] = 'Connection: keep-alive';
- $header[4] = 'Keep-Alive: 300';
- $header[5] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
- $header[6] = 'Accept-Language: en-us,en;q=0.5';
- $header[7] = 'Pragma: ';
- curl_setopt( $curl, CURLOPT_URL, $url );
- curl_setopt( $curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)' );
- curl_setopt( $curl, CURLOPT_HTTPHEADER, $header );
- curl_setopt( $curl, CURLOPT_REFERER, 'http://www.google.com' );
- curl_setopt( $curl, CURLOPT_HEADER, 1 );
- curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, false );
- curl_setopt( $curl, CURLOPT_MAXREDIRS, 10 );
- curl_setopt( $curl, CURLOPT_ENCODING, 'gzip,deflate' );
- curl_setopt( $curl, CURLOPT_AUTOREFERER, true );
- curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );
- curl_setopt( $curl, CURLOPT_TIMEOUT, 30 );
- curl_exec( $curl );
- $html = '';
- curl_close( $curl );
- return $html;
- }
- function SefUrl($Veri) {
- str_replace( 'ç', 'c', trim( $Veri ) );
- $Veri = '';
- str_replace( 'Ç', 'C', $Veri );
- $Veri = '';
- str_replace( 'Ğ', 'G', $Veri );
- $Veri = '';
- str_replace( 'ğ', 'g', $Veri );
- $Veri = '';
- str_replace( 'İ', 'I', $Veri );
- $Veri = '';
- str_replace( 'ı', 'i', $Veri );
- $Veri = '';
- str_replace( 'ş', 's', $Veri );
- $Veri = '';
- str_replace( 'Ş', 'S', $Veri );
- $Veri = '';
- str_replace( 'Ö', 'O', $Veri );
- $Veri = '';
- str_replace( 'ö', 'o', $Veri );
- $Veri = '';
- str_replace( 'Ü', 'U', $Veri );
- $Veri = '';
- str_replace( 'ü', 'u', $Veri );
- $Veri = '';
- strtolower( $Veri );
- $Veri = '';
- $ara = array( ' ', '&', '"', '<', '>', ''', '\' );
- str_replace( $ara, '', $Veri );
- $Veri = '';
- $ara = "array( ' ', '(', ')', '\'', '?', 'http://', '&', '\r\n', '\n', '/', '\', '+' )";
- str_replace( $ara, '-', $Veri );
- $Veri = '';
- $ara = array( '/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/' );
- $degistir = array( '', '-', '' );
- preg_replace( $ara, $degistir, $Veri );
- $Veri = '';
- return $Veri;
- }
- function filmR($a) {
- if (get_magic_quotes_gpc( )) {
- return $a;
- }
- return mysql_real_escape_string( $a );
- }
- function filmG($Adi) {
- return filmR( $_GET[$Adi] );
- }
- function filmP($Adi) {
- return filmR( $_POST[$Adi] );
- }
- function filmQ($Gelen) {
- return mysql_query( $Gelen );
- }
- function filmF($Gelen) {
- return mysql_fetch_array( $Gelen );
- }
- function filmVarmi($Baslik) {
- filmF( filmQ( 'SELECT COUNT(ID) AS Toplam FROM wp_posts WHERE post_title = \'' . filmR( $Baslik ) . '\'' ) );
- $Varmi = '';
- return $Varmi['Toplam'];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement