
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php

defined( 'PRESSO_POPULAR_POSTS_CACHE_EXPIRATION' ) || define( 'PRESSO_POPULAR_POSTS_CACHE_EXPIRATION', 12 * HOUR_IN_SECONDS ); // seconds


/* -----------------------------------------------------------------------------
 * Load Plugin Adapter
 * -------------------------------------------------------------------------- */

// if ( class_exists( 'Post_Views_Counter' ) ) {
// 	require_once get_template_directory().'/inc/post-views/adapter-post-views-counter.php';
// }

if ( class_exists( 'WordpressPopularPosts' ) ) {
	require_once get_template_directory().'/inc/post-views/adapter-wordpress-popular-posts.php';
	defined( 'PRESSO_HAS_POST_VIEWS' ) || define( 'PRESSO_HAS_POST_VIEWS', true );

} else {
	require_once get_template_directory().'/inc/post-views/adapter-mockup.php';
	defined( 'PRESSO_HAS_POST_VIEWS' ) || define( 'PRESSO_HAS_POST_VIEWS', false );

}



/* -----------------------------------------------------------------------------
 * The Post Views Counter
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_the_post_view' ) ) {
	function presso_the_post_view() {
		if ( PRESSO_HAS_POST_VIEWS ) {
			echo '<span class="vw-post-views">';
			printf( esc_html( _n( '%s View', '%s Views', 'presso' ) ), presso_number_prefixes( apply_filters( 'presso_filter_the_post_views', presso_get_post_views() ) ) );
			echo '</span>';
		}
	}
}

if ( ! function_exists( 'presso_the_post_view_icon' ) ) {
	function presso_the_post_view_icon() {
		if ( PRESSO_HAS_POST_VIEWS ) {
			echo '<span class="vw-post-views">';
			echo '<i class="vw-icon icon-entypo-eye"></i> ';
			echo esc_html( presso_number_prefixes( apply_filters( 'presso_filter_the_post_views', presso_get_post_views() ) ) );
			echo '</span>';
		}
	}
}


/* -----------------------------------------------------------------------------
 * Post Views Forgery
 * -------------------------------------------------------------------------- */
add_filter( 'presso_filter_the_post_views', 'presso_post_views_forgery', 10, 1 );
if ( ! function_exists( 'presso_post_views_forgery' ) ) {
	function presso_post_views_forgery( $post_views ) {
		$post_views_forgery = presso_get_theme_option( 'post_views_forgery', 0 );
		return intval( $post_views ) + $post_views_forgery;
	}
}