Caesar adlı üyeden alıntı: mesajı görüntüle
Satın aldık diye herşeyi yapandan beklemekte ayıp aslında 3 kuruş paraya alıyoruz bizde geliştirelim herkes faydalansın.

Temaya ek olarak tarafımdan yapılan geliştirmeler; (Geliştirdikçe ekleyeceğim buraya, Keremiyada bunları sisteme ekleyebilir dilerse)



1. En çok izlenenler sidebar widgeti

Öncelikle caesar-encok-izlenen.php adında bir dosya yaratıyoruz.

Daha sonra notepad++ birlikte dosyamızı açıyoruz. Yukarıda Kodlama diye bir menü göreceksiniz. Oradan UTF-8 (BOM'suz) olarak kodla seçeneğini seçmeniz lazım aksi halde Türkçe karakterler şinanay olabilir.

Daha sonra dosyanın içerisine aşağıdaki kodları birebir yapıştırıyoruz;

<?php // Caesar en çok izlenenler widget başlangıcı

add_action('widgets_init', 'caesar_boxes_widgets');

function caesar_boxes_widgets() {
	register_widget('Caesar_en_cok_izlenen');
}

class Caesar_en_cok_izlenen extends WP_Widget {
	function Caesar_en_cok_izlenen() {
		$widget_ops = array('classname' => 'encok-content', 'description' => _k_("En çok izlenen videolar listesi."));
		$this->WP_Widget( 'encok-content', _k_('+ En çok izlenen videolar'), $widget_ops);
	}

	function widget( $args, $instance ) {
		global $post;
		extract( $args );
		$title = apply_filters('widget_title', $instance['title'] );
		$posts_per_page = $instance['posts_per_page'];
		$diout = $instance['diout'];
			
		
		$NewQuery = new WP_Query(array( 'posts_per_page' => $posts_per_page,  'post_status' => 'publish', 'caller_get_posts' => 1, 'post_type' => 'post', 'meta_key' => 'views', 'orderby'=> 'meta_value_num', 'order' => 'DESC')); 

		if($NewQuery->found_posts > $number) {
			$link = get_category_link($cat);
			$link = '';
		}

		// Widget Başlangıçı
		echo $before_widget; ?>
		
	<?php echo $before_title . $title . $link . $after_title; ?>
	
	<?php	
		if ($NewQuery->have_posts()) : while ($NewQuery->have_posts()) : $NewQuery->the_post();
			?>
			<div class="video">
			<a href="<?php the_permalink(); ?>">
				<div class="izimg">
				<span class="duration"><?php echo get_post_meta($post->ID, "video_duration", true); ?></span>
				<span class="img"></span>
				<?php keremiya_resim("82px", "146px", "keremiya-medium"); ?>
				</div>
			</a>
			<div class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
			<?php if(keremiya_get_option("similar_author")){ ?>
				<span class="ek"><?php _k("gönderen:"); ?> <?php the_author(); ?></span>
			<?php }; ?>
			<span class="iz"><?php echo keremiya_izlenme(" "._k_("görüntüleme")); ?></span>
			</div>
			<?php
			endwhile;
		else : 
		echo '<p style="margin:2px 0px 4px 5px;">'._k_("Üzgünüz, arşivde hiç bir video bulunamadı.").'</p>'; 
		endif; wp_reset_query();

		echo "\r\t<div class=\"clear\"></div>";
		echo $after_widget;
}

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['posts_per_page'] = $new_instance['posts_per_page'];	
		$instance['post_sort'] = $new_instance['post_sort'];
		$instance['post_order'] = $new_instance['post_order'];
		return $instance;
	} 


	function form( $instance ) {
		$defaults = array( 'title' => '',  'posts_per_page' => 5, 'post_sort' => 'date', 'post_order' => 'desc', 'meta_key' => 'views', 'orderby'=> 'meta_value_num', 'order' => 'desc'); 
		$instance = wp_parse_args( (array) $instance, $defaults );
		
	$categories_obj = get_categories('hide_empty=0');
	$categories = array();
	foreach ($categories_obj as $pn_cat) {
		$categories[$pn_cat->cat_ID] = $pn_cat->cat_name;
	}
	?>
	
	<p>
	<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _k("Başlık"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" type="text">
	</p>
		
	<p>
	<label for="<?php echo $this->get_field_id( 'posts_per_page' ); ?>"><?php _k("Gösterilecek Video Sayısı"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'posts_per_page' ); ?>" name="<?php echo $this->get_field_name( 'posts_per_page' ); ?>" value="<?php echo $instance['posts_per_page']; ?>" type="text">
	</p>
	
	<input type="hidden" name="widget-options" id="widget-options" value="1" />
	<?php
	}
} 
// Son ?>
Dosyayı kaydedip kapatıyoruz. Daha sonra Filezilla yada Cuteftp yardımı ile FTP sunucumuza bağlanıp;

/wp-content/themes/vidyomax/inc/functions/widgets/

Klasörü içerisine dosyamızı upload ediyoruz.

Geldik son işleme;

/wp-content/themes/vidyomax/inc/

Klasörü içerisinde inc.php dosyasını bulup açıyoruz. içerisinde;

include (TEMPLATEPATH . '/inc/functions/widgets/caesar-encok-izlenen.php');
Kodunu ekliyoruz. Şu şekilde görünecektir;

include (TEMPLATEPATH . '/inc/functions/widgets/keremiya-video-kutusu.php');
include (TEMPLATEPATH . '/inc/functions/widgets/keremiya-comments.php');
include (TEMPLATEPATH . '/inc/functions/widgets/caesar-encok-izlenen.php');
Kodu ekleyip kaydettik sonra widgetimiz aktif durumdadır.

WP Yönetim paneli > Görünüm > Bileşenler

Sekmesine + En çok izlenen videolar widgeti gelmiştir. Dilediğiniz Sidebar'a kaydırarak kullanabilirsiniz.

Örnek olarak http://www.videoseyredin.com/sizin-i...ip-cekimi.html adresinde sağ side bar sekmesinde görebilirsiniz.
Saygılar.

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 16:49:47 -->-> Daha önceki mesaj 16:00:32 --

2. Kategoriye göre en çok izlenen videolar

caesar-encok-kategori-video.php dosyayı notepad++ ile açıp Kodlamasını UTF-8 BOM'suz yaptıktan sonra içerisine;

<?php // Caesar kategori bazlı en çok izlenen videolar
add_action('widgets_init', 'caesarkat_boxes_widgets');

function caesarkat_boxes_widgets() {
	register_widget('Caesar_encok_kategori_video');
}

class Caesar_encok_kategori_video extends WP_Widget {
	function Caesar_encok_kategori_video() {
		$widget_ops = array('classname' => 'katencok-content', 'description' => _k_("Kategoride en çok izlenen videolar listesi."));
		$this->WP_Widget( 'katencok-content', _k_('+ Kategoribazlı en çok izlenenler'), $widget_ops);
	}

	function widget( $args, $instance ) {
		global $post;
		extract( $args );
		$title = apply_filters('widget_title', $instance['title'] );
		$posts_per_page = $instance['posts_per_page'];
		$cat = $instance['cat'];
		$post_sort = $instance['post_sort'];
		$post_order = $instance['post_order'];
		$diout = $instance['diout'];
		
		$NewQuery = new WP_Query(array( 'posts_per_page' => $posts_per_page, 'cat' => $cat, 'post_sort' => $post_sort, 'post_order' => $post_order, 'post_status' => 'publish', 'caller_get_posts' => 1, 'post_type' => 'post', 'meta_key' => 'views', 'orderby'=> 'meta_value_num', 'order' => 'DESC')); 

		if($NewQuery->found_posts > $number) {
			$link = get_category_link($cat);
			$link = '';
		}

		// Widget Başlangıçı
		echo $before_widget; ?>
		
	<?php echo $before_title . $title . $link . $after_title; ?>
	
	<?php	
		if ($NewQuery->have_posts()) : while ($NewQuery->have_posts()) : $NewQuery->the_post();
			?>
			<div class="video">
			<a href="<?php the_permalink(); ?>">
				<div class="izimg">
				<span class="duration"><?php echo get_post_meta($post->ID, "video_duration", true); ?></span>
				<span class="img"></span>
				<?php keremiya_resim("82px", "146px", "keremiya-medium"); ?>
				</div>
			</a>
			<div class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
			<?php if(keremiya_get_option("similar_author")){ ?>
				<span class="ek"><?php _k("gönderen:"); ?> <?php the_author(); ?></span>
			<?php }; ?>
			<span class="iz"><?php echo keremiya_izlenme(" "._k_("görüntüleme")); ?></span>
			</div>
			<?php
			endwhile;
		else : 
		echo '<p style="margin:2px 0px 4px 5px;">'._k_("Üzgünüz, arşivde hiç bir video bulunamadı.").'</p>'; 
		endif; wp_reset_query();

		echo "\r\t<div class=\"clear\"></div>";
		echo $after_widget;
}

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['cat'] = strip_tags( $new_instance['cat'] );
		$instance['posts_per_page'] = $new_instance['posts_per_page'];	
		$instance['post_sort'] = $new_instance['post_sort'];
		$instance['post_order'] = $new_instance['post_order'];
		return $instance;
	} 


	function form( $instance ) {
		$defaults = array( 'title' => '', 'posts_per_page' => 5, 'cat' => '', 'post_sort' => 'date', 'post_order' => 'desc', 'meta_key' => 'views', 'orderby'=> 'meta_value_num', 'order' => 'DESC'); 
		$instance = wp_parse_args( (array) $instance, $defaults );
		
	$categories_obj = get_categories('hide_empty=0');
	$categories = array();
	foreach ($categories_obj as $pn_cat) {
		$categories[$pn_cat->cat_ID] = $pn_cat->cat_name;
	}
	?>
	
	<p>
	<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _k("Başlık"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" type="text">
	</p>
	<label for="<?php echo $this->get_field_id( 'cat' ); ?>"><?php _k("Kategori"); ?></label>
	<select class="widefat" id="<?php echo $this->get_field_id( 'cat' ); ?>" name="<?php echo $this->get_field_name( 'cat' ); ?>">
				<?php foreach ($categories as $key => $option) { ?>
				<option value="<?php echo $key ?>" <?php if ( $instance['cat']  == $key) { echo ' selected="selected"' ; } ?>><?php echo $option; ?></option>
				<?php } ?>
	</select>
	</p>		
	<p>
	<label for="<?php echo $this->get_field_id( 'posts_per_page' ); ?>"><?php _k("Gösterilecek Video Sayısı"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'posts_per_page' ); ?>" name="<?php echo $this->get_field_name( 'posts_per_page' ); ?>" value="<?php echo $instance['posts_per_page']; ?>" type="text">
	</p>
	
	<input type="hidden" name="widget-options" id="widget-options" value="1" />
	<?php
	}
} 
// Son ?>
Kodlarını yapiştirip kaydedip /wp-content/themes/vidyomax/inc/functions/widgets/ klasörü içerisine atıyoruz.

Daha sonra;

/httpdocs/wp-content/themes/vidyomax/inc/inc.php

dosyasını açıp içerisine;

include (TEMPLATEPATH . '/inc/functions/widgets/caesar-encok-kategori-video.php');
Ekliyoruz. Widgetimiz;

WP Admin > Görünüm > Bileşenler

İçerisinde aktif olacaktır. Dilediğiniz sidebara kaydırıp dilediğiniz kategorideki en çok izlenen videolar sekmesini gösterebilirsiniz.

Saygılar.

--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 18:36:32 -->-> Daha önceki mesaj 17:37:54 --

3. En çok yorum alan videolar widgeti

caesar-encok-yorumalan.php adlı dosyayı yaratıp notepad++ ile açıyoruz. Yukarıda Kodlama bölümünden UTF-8 BOM'suz seçiyoruz.

Daha sonra dosya içerisine;

<?php // Caesar en çok yorum alan videolar

add_action('widgets_init', 'caesar_yorumalan_boxes_widgets');

function caesar_yorumalan_boxes_widgets() {
	register_widget('Caesar_encok_yorumalan');
}

class Caesar_encok_yorumalan extends WP_Widget {
	function Caesar_encok_yorumalan() {
		$widget_ops = array('classname' => 'encokyorum-content', 'description' => _k_("En çok yorum alan videolar listesi."));
		$this->WP_Widget( 'encokyorum-content', _k_('+ En çok yorum alan videolar'), $widget_ops);
	}

	function widget( $args, $instance ) {
		global $post;
		extract( $args );
		$title = apply_filters('widget_title', $instance['title'] );
		$posts_per_page = $instance['posts_per_page'];
		$diout = $instance['diout'];
			
		
		$NewQuery = new WP_Query(array( 'posts_per_page' => $posts_per_page,  'post_status' => 'publish', 'caller_get_posts' => 1, 'post_type' => 'post', 'orderby'=> 'comment_count', 'order' => 'DESC')); 

		if($NewQuery->found_posts > $number) {
			$link='';
		}

		// Widget Başlangıçı
		echo $before_widget; ?>
		
	<?php echo $before_title . $title . $link . $after_title; ?>
	
	<?php	
		if ($NewQuery->have_posts()) : while ($NewQuery->have_posts()) : $NewQuery->the_post();
			?>
			<div class="video">
			<a href="<?php the_permalink(); ?>">
				<div class="izimg">
				<span class="duration"><?php echo get_post_meta($post->ID, "video_duration", true); ?></span>
				<span class="img"></span>
				<?php keremiya_resim("82px", "146px", "keremiya-medium"); ?>
				</div>
			</a>
			<div class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
			<?php if(keremiya_get_option("similar_author")){ ?>
				<span class="ek"><?php _k("gönderen:"); ?> <?php the_author(); ?></span>
			<?php }; ?>
			<span class="iz"><?php echo keremiya_izlenme(" "._k_("görüntüleme")); ?></span>
			<span class="iz"><?php echo get_comments_number(); ?> yorum</span>
			</div>
			<?php
			endwhile;
		else : 
		echo '<p style="margin:2px 0px 4px 5px;">'._k_("Üzgünüz, arşivde hiç yorum alan video bulunamadı").'</p>'; 
		endif; wp_reset_query();

		echo "\r\t<div class=\"clear\"></div>";
		echo $after_widget;
}

	function update( $new_instance, $old_instance ) {
		$instance = $old_instance;
		$instance['title'] = strip_tags( $new_instance['title'] );
		$instance['posts_per_page'] = $new_instance['posts_per_page'];	
		$instance['post_sort'] = $new_instance['post_sort'];
		$instance['post_order'] = $new_instance['post_order'];
		return $instance;
	} 


	function form( $instance ) {
		$defaults = array( 'title' => '',  'posts_per_page' => 5, 'post_sort' => 'date', 'post_order' => 'desc', 'orderby'=> 'comment_count', 'order' => 'DESC'); 
		$instance = wp_parse_args( (array) $instance, $defaults );
		
	$categories_obj = get_categories('hide_empty=0');
	$categories = array();
	foreach ($categories_obj as $pn_cat) {
		$categories[$pn_cat->cat_ID] = $pn_cat->cat_name;
	}
	?>
	
	<p>
	<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _k("Başlık"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" type="text">
	</p>
		
	<p>
	<label for="<?php echo $this->get_field_id( 'posts_per_page' ); ?>"><?php _k("Gösterilecek Video Sayısı"); ?></label>
	<input class="widefat" id="<?php echo $this->get_field_id( 'posts_per_page' ); ?>" name="<?php echo $this->get_field_name( 'posts_per_page' ); ?>" value="<?php echo $instance['posts_per_page']; ?>" type="text">
	</p>
	
	<input type="hidden" name="widget-options" id="widget-options" value="1" />
	<?php
	}
} 
// Son ?>
Kodlarını yapıştırıp kaydediyoruz. Keydettiğimiz bu dosyayı;

/wp-content/themes/vidyomax/inc/functions/widgets/

İçerisine atıyoruz. Daha sonra;

/wp-content/themes/vidyomax/inc/inc.php dosyasını açıp içerisine;

include (TEMPLATEPATH . '/inc/functions/widgets/caesar-encok-yorumalan.php');
Bölümünü ekliyoruz.

WP Admin -> Görünüm -> Bileşenler

Kısmında yeni widgetimiz hazır oluyor. Daha sonra hangi sidebar'a eklemek istiyorsak sürüklüyoruz.

Demo: http://www.videoseyredin.com/category/spor linkinde sağ kısımda görebilirsiniz.

Saygılar.
Bu arkadaşın bahsettikleri temaya uygulandımı?
Birde video değilde resim sitesinde bu temayı kullanmak mümkün mü?