Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function ara($bas, $son, $yazi) {
- @preg_match_all( '/' . @preg_quote( $bas, '/' ) . '(.*?)' . @preg_quote( $son, '/' ) . '/i', $yazi, $m );
- return $m[1];
- }
- function guncelleme() {
- $guncelleme_txt = ;
- ara( '<versiyon>', '</versiyon>', $guncelleme_txt );
- $versiyon = ;
- ara( '<notlar>', '</notlar>', $guncelleme_txt );
- $notlar = file_get_contents( 'https://dl.dropboxusercontent.com/u/93138868/wptr/portalv1/guncelleme.txt' );
- wp_get_theme( );
- $tatil_tema = ;
- if ($tatil_tema->Version != $versiyon[0]) {
- echo ' <div class="error">
- <p>';
- echo $notlar[0];
- echo '</p>
- </div>
- ';
- }
- }
- function wp_footter() {
- global $ayarlar;
- echo '</div><!--/icerik-->
- </div><!--/site-->
- <div id="alt" class="t">
- <div class="orta">
- <div class="logo sol">
- ';
- if (get_option( 'logo' )) {
- echo ' <a href="';
- bloginfo( url );
- echo '"><img src="';
- echo get_option( 'logo' );
- echo '" /></a>
- ';
- }
- else {
- echo ' <h2><a href="';
- bloginfo( url );
- echo '">';
- bloginfo( name );
- echo '</a></h2>
- ';
- }
- echo ' </div><!--/logo-->
- <div class="sag">
- <div class="db">
- ';
- echo $ayarlar['alt'];
- echo ' </div>
- <div class="db sosyal-ag">
- <a href="';
- echo $ayarlar['fb'];
- echo '"><i class="f icon-facebook-sign"></i>Facebook</a>
- <a href="';
- echo $ayarlar['tw'];
- echo '"><i class="tw icon-twitter-sign"></i>Twitter</a>
- <a href="';
- echo $ayarlar['gp'];
- echo '"><i class="g icon-google-plus-sign"></i>Google+</a>
- </div>
- <div class="db" style="margin-top:5px;">
- Portal Teması : <a href="http://wptr.co" title="wordpress">Wptr.Co</a>
- </div>
- </div>
- </div>
- </div>
- ';
- }
- function wptr_portal_tarih($uni, $date) {
- $fark_tarih = time( ) - $uni;
- $kontrol_tarih_saniye = ;
- $kontrol_tarih_dakika = $fark_tarih;
- round( $fark_tarih \ 3600 );
- $kontrol_tarih_saat = round( $fark_tarih \ 60 );
- if ($kontrol_tarih_saniye < 60) {
- echo $kontrol_tarih_saniye . ' saniye önce';
- return null;
- }
- if ($kontrol_tarih_dakika < 60) {
- echo $kontrol_tarih_dakika . ' dakika önce';
- return null;
- }
- if ($kontrol_tarih_saat < 24) {
- echo $kontrol_tarih_saat . ' saat önce';
- return null;
- }
- wptr_portal_turkce_tarih( $date );
- $cevir = ;
- echo $cevir[format3];
- }
- function wptr_portal_turkce_tarih($tarih = '') {
- if ($tarih = '') {
- date( 'Y-m-d H:i:s' );
- $tarih = ;
- }
- $tarihDizi['gunler'] = array( 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi' );
- $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' );
- explode( ' ', $tarih );
- $zamanExp = ;
- explode( '-', $zamanExp[0] );
- $tarihExp = ;
- strftime( '%w', strtotime( $tarih ) );
- $haftaninGunu = ;
- $tarihDizi['aylar'][$tarihExp[1]];
- $tarihFormat['ay'] = ;
- $tarihDizi['gunler'][$haftaninGunu];
- $tarihFormat['haftanin_gunu'] = ;
- $zamanExp[1];
- $tarihFormat['saat'] = ;
- $tarihFormat['format1'] = $tarihExp[2] . ' ' . $tarihFormat['ay'] . ' ' . $tarihExp[0];
- $tarihFormat['format2'] = $tarihFormat['format1'] . ' ' . $tarihFormat['saat'];
- $tarihFormat['format3'] = $tarihExp[2] . ' ' . $tarihFormat['ay'] . ' ' . $tarihExp[0];
- $tarihFormat['format4'] = $tarihFormat['format3'] . ' ' . $tarihFormat['haftanin_gunu'];
- return $tarihFormat;
- }
- function wptr_portal_kullanici_profil_linki($id) {
- get_option( 'permalink_structure' );
- $permalink_yapi = ;
- if ($permalink_yapi = '') {
- $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/?author=' . $id;
- }
- else {
- get_userdata( $id );
- str_replace( ' ', '-', $user_info->user_login );
- $adi = ;
- strpos( $permalink_yapi, 'index.php' );
- $pos = $user_info = ;
- if ($pos = FALSE) {
- $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/author/' . $adi . '/';
- }
- else {
- $kullanici_profil_linki_p = get_option( 'siteurl' ) . '/index.php/author/' . $adi;
- }
- }
- return $kullanici_profil_linki_p;
- }
- function wptr_portal_resim($yazi_id, $thumb = 'medium') {
- get_post_meta( $yazi_id, 'resim', true );
- $resim = ;
- if ($resim != '') {
- echo ' <img src="';
- echo $resim;
- echo '" alt="';
- echo get_the_title( $yazi_id );
- echo '" />
- ';
- return null;
- }
- if (has_post_thumbnail( $yazi_id )) {
- echo ' ';
- echo the_post_thumbnail( $thumb, array( 'alt' => get_the_title( ) ) );
- echo ' ';
- return null;
- }
- echo ' <img src="';
- bloginfo( template_url );
- echo '/lib/assets/img/resim-yok.png" alt="';
- echo get_the_title( $yazi_id );
- echo '" />>
- ';
- }
- function wptr_portal_resim_src($yazi_id, $thumb = 'medium') {
- get_post_meta( $yazi_id, 'resim', true );
- $resim = ;
- if (!has_post_thumbnail( $yazi_id )) {
- return $resim;
- }
- wp_get_attachment_image_src( get_post_thumbnail_id( $yazi_id ), $thumb );
- $one_cikan_resim = ;
- return esc_attr( $one_cikan_resim[0] );
- }
- add_action( 'admin_notices', 'guncelleme' );
- add_action( 'wp_footer', 'wp_footter' );
- add_theme_support( 'post-thumbnails' );
- update_option( 'thumbnail_crop', 1 );
- add_image_size( 'boyut630x320', 630, 320, true );
- add_image_size( 'boyut140x110', 140, 110, true );
- add_image_size( 'boyut110x70', 110, 70, true );
- add_image_size( 'boyut70x40', 70, 40, true );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement