[ create a new paste ] login | about

Link: http://codepad.org/NVLJb5Wl    [ raw code | output | fork ]

PHP, pasted on Apr 3:
<?php
require_once('class-tgm-plugin-activation.php');
include ( 'getplugins.php' );
include ( 'cpt.php' );
include ( 'guide.php' );
include ( 'metabox.php' );

load_theme_textdomain ('tgmpa', TEMPLATEPATH . '/DBS-Lang');
load_theme_textdomain ( TEMPLATEPATH . '/DBS-Lang');

/* SIDEBARS */
if ( function_exists('register_sidebar') )

	register_sidebar(array(
	'name' => 'Sidebar',
    'before_widget' => '<li class="sidebox %2$s">',
    'after_widget' => '</li>',
	'before_title' => '<h3 class="sidetitl">',
    'after_title' => '</h3>',
	
    ));

	register_sidebar(array(
	'name' => 'Footer',
	'before_widget' => '<li class="botwid %2$s">',
	'after_widget' => '</li>',
	'before_title' => '<h3 class="bothead">',
	'after_title' => '</h3>',
	));		



// Feed link

add_theme_support( 'automatic-feed-links' );

// Content Width

if ( ! isset( $content_width ) ) $content_width = 700;

/* CUSTOM MENUS */	

register_nav_menus( array(
		'primary' => __( 'Primary Navigation', '' ),
	) );

function fallbackmenu(){ ?>
			<div id="submenu">
				<ul><li> Go to Adminpanel > Appearance > Menus to create your menu. You should have WP 3.0+ version for custom menus to work.</li></ul>
			</div>
<?php }	


/* FEATURED THUMBNAILS */

if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
	add_theme_support( 'post-thumbnails' );
	add_image_size( 'tuts_index', 250, 200, true );
	add_image_size( 'story_feature', 150, 100, true );
	add_image_size( 'video_feature', 150, 200, true );
	add_image_size( 'review_thumb', 120, 80, true );
	add_image_size( 'post_image', 660, 350, true ); //Last 300,187
}




/* PAGE NAVIGATION */

function getpagenavi(){
	?>
	<div id="navigation" class="clearfix">
	<?php if(function_exists('wp_pagenavi')) : ?>
	<?php wp_pagenavi() ?>
	<?php else : ?>
	        <div class="alignleft"><?php next_posts_link(__('&laquo; Older Entries','web2feeel')) ?></div>
	        <div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;','web2feel')) ?></div>
	        <div class="clear"></div>
	<?php endif; ?>

	</div>

	<?php
	}
	
	
	

// ADDS POST TYPES TO RSS FEED
function myfeed_request($qv) {
	if (isset($qv['feed']))
		$qv['post_type'] = get_post_types();
	return $qv;
}
add_filter('request', 'myfeed_request');


//FLUSH REWRITE RULES

	function custom_flush_rewrite_rules() {
		global $pagenow, $wp_rewrite;
		if ( 'themes.php' == $pagenow && isset( $_GET['activated'] ) )
			$wp_rewrite->flush_rules();
	}

	add_action( 'load-themes.php', 'custom_flush_rewrite_rules' );

// نمایش تعداد بازدیدها
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "بازدید : ۰";
}
return $count.' بازدید';
}
// شمارش بازدیدها
function setPostViews($postID) {
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}
add_filter('manage_posts_columns', 'posts_column_views');
add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2);
function posts_column_views($defaults){
$defaults['post_views'] = __('بازدیدها');
return $defaults;
}
function posts_custom_column_views($column_name, $id){
if($column_name === 'post_views'){
echo getPostViews(get_the_ID());
}
}

?>


Output:
1
2
3
4

Warning: require_once(class-tgm-plugin-activation.php): failed to open stream: No such file or directory on line 2

Fatal error: require_once(): Failed opening required 'class-tgm-plugin-activation.php' (include_path='.:/usr/lib/php') on line 2


Create a new paste based on this one


Comments: