Advertisement
Guest User

Untitled

a guest
Oct 12th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.51 KB | None | 0 0
  1. <?php
  2.  
  3.     function ara($bas, $son, $yazi) {
  4.         @preg_match_all( '/' . @preg_quote( $bas, '/' ) . '(.*?)' . @preg_quote( $son, '/' ) . '/i', $yazi, $m );
  5.         return $m[1];
  6.     }
  7.  
  8.     function guncelleme() {
  9.         $guncelleme_txt = ;
  10.         ara( '<versiyon>', '</versiyon>', $guncelleme_txt );
  11.         $versiyon = ;
  12.         ara( '<notlar>', '</notlar>', $guncelleme_txt );
  13.         $notlar = file_get_contents( 'https://dl.dropboxusercontent.com/u/93138868/wptr/portalv1/guncelleme.txt' );
  14.         wp_get_theme(  );
  15.         $tatil_tema = ;
  16.  
  17.         if ($tatil_tema->Version != $versiyon[0]) {
  18.             echo '      <div class="error">
  19.             <p>';
  20.             echo $notlar[0];
  21.             echo '</p>
  22.         </div>
  23.    ';
  24.         }
  25.  
  26.     }
  27.  
  28.     function wp_footter() {
  29.         global $ayarlar;
  30.  
  31.         echo '</div><!--/icerik-->
  32. </div><!--/site-->
  33. <div id="alt" class="t">
  34.     <div class="orta">
  35.         <div class="logo sol">
  36.             ';
  37.  
  38.         if (get_option( 'logo' )) {
  39.             echo '          <a href="';
  40.             bloginfo( url );
  41.             echo '"><img src="';
  42.             echo get_option( 'logo' );
  43.             echo '" /></a>
  44.             ';
  45.         }
  46. else {
  47.             echo '          <h2><a href="';
  48.             bloginfo( url );
  49.             echo '">';
  50.             bloginfo( name );
  51.             echo '</a></h2>
  52.             ';
  53.         }
  54.  
  55.         echo '      </div><!--/logo-->
  56.         <div class="sag">
  57.             <div class="db">
  58.                 ';
  59.         echo $ayarlar['alt'];
  60.         echo '          </div>
  61.             <div class="db sosyal-ag">
  62.                 <a href="';
  63.         echo $ayarlar['fb'];
  64.         echo '"><i class="f icon-facebook-sign"></i>Facebook</a>
  65.                 <a href="';
  66.         echo $ayarlar['tw'];
  67.         echo '"><i class="tw icon-twitter-sign"></i>Twitter</a>
  68.                 <a href="';
  69.         echo $ayarlar['gp'];
  70.         echo '"><i class="g icon-google-plus-sign"></i>Google+</a>
  71.             </div>
  72.             <div class="db" style="margin-top:5px;">
  73.                 Portal Teması : <a href="http://wptr.co" title="wordpress">Wptr.Co</a>
  74.             </div>
  75.         </div>
  76.     </div>
  77. </div>
  78. ';
  79.     }
  80.  
  81.     function wptr_portal_tarih($uni, $date) {
  82.         $fark_tarih = time(  ) - $uni;
  83.         $kontrol_tarih_saniye = ;
  84.         $kontrol_tarih_dakika = $fark_tarih;
  85.         round( $fark_tarih \ 3600 );
  86.         $kontrol_tarih_saat = round( $fark_tarih \ 60 );
  87.  
  88.         if ($kontrol_tarih_saniye < 60) {
  89.             echo $kontrol_tarih_saniye . ' saniye önce';
  90.             return null;
  91.         }
  92.  
  93.  
  94.         if ($kontrol_tarih_dakika < 60) {
  95.             echo $kontrol_tarih_dakika . ' dakika önce';
  96.             return null;
  97.         }
  98.  
  99.  
  100.         if ($kontrol_tarih_saat < 24) {
  101.             echo $kontrol_tarih_saat . ' saat önce';
  102.             return null;
  103.         }
  104.  
  105.         wptr_portal_turkce_tarih( $date );
  106.         $cevir = ;
  107.         echo $cevir[format3];
  108.     }
  109.  
  110.     function wptr_portal_turkce_tarih($tarih = '') {
  111.         if ($tarih  = '') {
  112.             date( 'Y-m-d H:i:s' );
  113.             $tarih = ;
  114.         }
  115.  
  116.         $tarihDizi['gunler'] = array( 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi' );
  117.         $tarihDizi['aylar'] = array( '01' => 'Ocak', '02' => 'Şubat', '03' => 'Mart', '04' => 'Nisan', '05' => 'Mayıs', '06' => 'Haziran', '07' => 'Temmuz', '08' => 'Ağustos', '09' => 'Eylül', '10' => 'Ekim', '11' => 'Kasım', '12' => 'Aralık' );
  118.         explode( ' ', $tarih );
  119.         $zamanExp = ;
  120.         explode( '-', $zamanExp[0] );
  121.         $tarihExp = ;
  122.         strftime( '%w', strtotime( $tarih ) );
  123.         $haftaninGunu = ;
  124.         $tarihDizi['aylar'][$tarihExp[1]];
  125.         $tarihFormat['ay'] = ;
  126.         $tarihDizi['gunler'][$haftaninGunu];
  127.         $tarihFormat['haftanin_gunu'] = ;
  128.         $zamanExp[1];
  129.         $tarihFormat['saat'] = ;
  130.         $tarihFormat['format1'] = $tarihExp[2] . ' ' . $tarihFormat['ay'] . ' ' . $tarihExp[0];
  131.         $tarihFormat['format2'] = $tarihFormat['format1'] . ' ' . $tarihFormat['saat'];
  132.         $tarihFormat['format3'] = $tarihExp[2] . ' ' . $tarihFormat['ay'] . ' ' . $tarihExp[0];
  133.         $tarihFormat['format4'] = $tarihFormat['format3'] . ' ' . $tarihFormat['haftanin_gunu'];
  134.         return $tarihFormat;
  135.     }
  136.  
  137.     function wptr_portal_kullanici_profil_linki($id) {
  138.         get_option( 'permalink_structure' );
  139.         $permalink_yapi = ;
  140.  
  141.         if ($permalink_yapi  = '') {
  142.             $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/?author=' . $id;
  143.         }
  144. else {
  145.             get_userdata( $id );
  146.             str_replace( ' ', '-', $user_info->user_login );
  147.             $adi = ;
  148.             strpos( $permalink_yapi, 'index.php' );
  149.             $pos = $user_info = ;
  150.  
  151.             if ($pos   = FALSE) {
  152.                 $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/author/' . $adi . '/';
  153.             }
  154. else {
  155.                 $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/index.php/author/' . $adi;
  156.             }
  157.         }
  158.  
  159.         return $kullanici_profil_linki_p;
  160.     }
  161.  
  162.     function wptr_portal_resim($yazi_id, $thumb = 'medium') {
  163.         get_post_meta( $yazi_id, 'resim', true );
  164.         $resim = ;
  165.  
  166.         if ($resim != '') {
  167.             echo '      <img src="';
  168.             echo $resim;
  169.             echo '" alt="';
  170.             echo get_the_title( $yazi_id );
  171.             echo '" />
  172.     ';
  173.             return null;
  174.         }
  175.  
  176.  
  177.         if (has_post_thumbnail( $yazi_id )) {
  178.             echo '      ';
  179.             echo the_post_thumbnail( $thumb, array( 'alt' => get_the_title(  ) ) );
  180.             echo '  ';
  181.             return null;
  182.         }
  183.  
  184.         echo '      <img src="';
  185.         bloginfo( template_url );
  186.         echo '/lib/assets/img/resim-yok.png" alt="';
  187.         echo get_the_title( $yazi_id );
  188.         echo '" />>
  189.     ';
  190.     }
  191.  
  192.     function wptr_portal_resim_src($yazi_id, $thumb = 'medium') {
  193.         get_post_meta( $yazi_id, 'resim', true );
  194.         $resim = ;
  195.  
  196.         if (!has_post_thumbnail( $yazi_id )) {
  197.             return $resim;
  198.         }
  199.  
  200.         wp_get_attachment_image_src( get_post_thumbnail_id( $yazi_id ), $thumb );
  201.         $one_cikan_resim = ;
  202.         return esc_attr( $one_cikan_resim[0] );
  203.     }
  204.  
  205.     add_action( 'admin_notices', 'guncelleme' );
  206.     add_action( 'wp_footer', 'wp_footter' );
  207.     add_theme_support( 'post-thumbnails' );
  208.     update_option( 'thumbnail_crop', 1 );
  209.     add_image_size( 'boyut630x320', 630, 320, true );
  210.     add_image_size( 'boyut140x110', 140, 110, true );
  211.     add_image_size( 'boyut110x70', 110, 70, true );
  212.     add_image_size( 'boyut70x40', 70, 40, true );
  213. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement