<?php

global $wpdb, $post, $opt_themes; 

$image_id					= get_post_thumbnail_id(); 
$image_url					= wp_get_attachment_image_src($image_id,'full', true); 
$image_url_default			= $image_url[0];
$thumbnail_images			= $image_url;
$post_id					= get_the_ID();
$url						= wp_get_attachment_url( get_post_thumbnail_id($post->ID), '64' );
$defaults_no_images			= $opt_themes['ex_themes_defaults_no_images_']['url'];
$thumb_id					= get_post_thumbnail_id( $id );
if ( '' != $thumb_id ) {
$thumb_url					= wp_get_attachment_image_src( $thumb_id, '64', true );
$image						= $thumb_url[0];
	} else {
$image						= $defaults_no_images;
	}
$urlimages2					= $image;

$thumbnails_gp				= get_post_meta( $post->ID, 'wp_poster_GP', true );
$thumbnails					= str_replace( 'http://', '', $thumbnails_gp );
$thumbnails					= str_replace( 'https://', '', $thumbnails_gp );
$randoms					= mt_rand(0, 2);
$cdn_thumbnails				= '//i'.$randoms.'.wp.com/'.$thumbnails.'';
$thumbnails					= get_post_meta( $post->ID, 'wp_poster_GP', true );
$defaults_no_images			= $opt_themes['ex_themes_defaults_no_images_']['url'];
$developer					= get_option('wp_developers_GP', 'developer');
$terms						= wp_get_post_terms($post->ID, $developer);
$sizes						= get_post_meta( $post->ID, 'wp_sizes', true ); 
$sizes_alt					= get_post_meta( $post->ID, 'wp_sizes_GP', true );
if ( $sizes === FALSE or $sizes == '' ) $sizes = $sizes_alt;
$version					= get_post_meta( $post->ID, 'wp_version', true );
$versionX1					= get_post_meta( $post->ID, 'wp_version_GP', true ); 
$versionX					= '-';
if ( $version === FALSE or $version == '' ) $version = $versionX1;
$version1					= get_post_meta( $post->ID, 'wp_version', true );
$versionX1					= get_post_meta( $post->ID, 'wp_version_GP', true );
$versionX					= '-';
if ( $version1 === FALSE or $version1 == '' ) $version1 = $versionX1;
$wp_installs_GP				= get_post_meta( $post->ID, 'wp_installs_GP', true );
$wp_installs_GP1			= get_post_meta( $post->ID, 'wp_installs_GP', true );
if ( $wp_installs_GP === FALSE or $wp_installs_GP == '' ) $wp_installs_GP = $wp_installs_GP1;
$wp_contentrated_GP			= get_post_meta( $post->ID, 'wp_contentrated_GP', true );
$wp_contentrated_GP1		= get_post_meta( $post->ID, 'wp_contentrated_GP', true );
if ( $wp_contentrated_GP === FALSE or $wp_contentrated_GP == '' ) $wp_contentrated_GP = $wp_contentrated_GP1;
$updates					= get_post_meta( $post->ID, 'wp_updates_GP', true );
$updatesX1					= get_post_meta( $post->ID, 'wp_updates_GP', true );
$updatesX					= '-';
if ( $updates === FALSE or $updates == '' ) $updates = $updatesX;	
$wp_mods					= get_post_meta( $post->ID, 'wp_mods1', true );
$wp_mods1					= get_post_meta( $post->ID, 'wp_mods', true );
if ( $wp_mods === FALSE or $wp_mods == '' ) $wp_mods = $wp_mods1; 
$title_ps					= get_post_meta( $post->ID, 'wp_title_GP', true );
$developer_ps				= get_post_meta( $post->ID, 'wp_developers_GP', true );
$apk_text_name				= $opt_themes['exthemes_NameAPK'];
$apk_text_publiser			= $opt_themes['exthemes_PublisherAPK'];
$apk_text_genre				= $opt_themes['exthemes_GenreAPK'];
$apk_text_size				= $opt_themes['exthemes_SizeAPK'];
$apk_text_version			= $opt_themes['exthemes_VersionAPK'];
$apk_text_update			= $opt_themes['exthemes_UpdateAPK'];
$apk_text_mod				= $opt_themes['exthemes_MODAPK'];
$apk_text_gps				= $opt_themes['exthemes_GPSAPK'];
$playstore_id		= get_post_meta(get_the_ID(), 'wp_GP_ID', true);
$url_ps_sources		= 'https://play.google.com/store/apps/details?id='.$playstore_id; 
$apk_mods					= get_post_meta( $post->ID, 'wp_mods', true );
$image_ids					= get_post_thumbnail_id($post->ID); 
 
$full						= 'thumbnails-alt-120'; 
 
$image_urls					= wp_get_attachment_image_src($image_ids, $full, true); 
$poster_imgs				= $image_urls[0]; 
$title						= get_post_meta( $post->ID, 'wp_title_GP', true );
$title_alt					= get_the_title();
$x_time						= get_the_time('c');
$u_time						= get_the_time('U');
$x_modified_time			= get_the_modified_time('c');
$u_modified_time			= get_the_modified_time('U');

$author_id						= $post->post_author;
$author_link					= get_author_posts_url( $author_id );
$author_avatar					= get_avatar_url( $author_id ); 
//$author							= get_the_author( $author_id );
$author							= get_the_author();
$authorx						= get_the_author_meta('display_name', $author_id);
$display_name					= $authorx;
/* 
$passthis_id					= $curauth->ID;
$user_info						= get_userdata(1);
$username						= $user_info->user_login;
$first_name						= $user_info->first_name;
$last_name						= $user_info->last_name;
$display_name					= $user_info->display_name;
 */
$desck_GPs					= get_post_meta( $post->ID, 'wp_desck_GP', true ); 
if ( $desck_GPs === FALSE or $desck_GPs == '' ) $desck_GPs = $post->post_content;	
$des_post					= trim(strip_tags( $desck_GPs ));
$des_post					= trim(strip_tags( $desck_GPs ));
$des_post					= preg_replace('~[\r\n]+~', '', $des_post);
$des_post					= str_replace('"', '', $des_post);
$des_post					= mb_substr( $des_post, 0, 200, 'utf8' );

$text_latest_update		= $opt_themes['text_latest_update'];
$text_post_on			= $opt_themes['text_post_on'];
$text_edit_post			= $opt_themes['text_edit_post'];
?>
 
<div class="d-flex align-items-center px-0 px-md-3 mt-3 mb-3 mb-md-4">
	<div class="flex-shrink-0 mr-3" style="width: 4.5rem;"> 
	
	 
	<img width="96" height="96" src="<?php if (get_the_post_thumbnail( get_the_ID() )) { echo wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'full' )[0]; } elseif(get_post_meta( get_the_ID(), 'wp_poster_GP', true )) { echo get_post_meta( get_the_ID(), 'wp_poster_GP', true ); } else { echo $opt_themes['ex_themes_defaults_no_images_']['url']; } ?>" class=" rounded-lg" alt="<?php the_title(); ?>" >
	 
	</div>
	<div>
	<h1 class="lead font-weight-semibold"><?php if($opt_themes['single_appname']){ echo get_post_meta( $post->ID, 'wp_title_GP', true); ?> <?php _e($opt_themes['text_18'], TEXT_DOMAIN); ?> <?php if(get_post_meta( $post->ID, 'wp_version_GP', true )){ echo get_post_meta( $post->ID, 'wp_version_GP', true ); } ?> <?php if(get_post_meta( $post->ID, 'wp_mods', true )){?>(<?php echo trim(strip_tags(ucwords(get_post_meta( $post->ID, 'wp_mods', true )))); ?>)<?php } } else { the_title(); } ?></h1>
	
	<?php if ($u_modified_time >= $u_time + 1) { echo "<time class=\"text-muted d-block\" datetime=\"".$x_modified_time."\"><em> ".$text_latest_update." "; the_modified_time('F j, Y'); ?> (<?php echo human_time_diff(get_the_modified_time('U'),current_time('U') ). ' ago '; ?>) <?php echo edit_post_link( __( $text_edit_post, THEMES_NAMES ), ' ', ' ' ); echo "</em></time>"; } else { ?><time class='text-muted d-block' datetime='<?php echo $x_time; ?>'><em> <?php echo $text_post_on; ?> <?php echo get_the_time('F j, Y'); ?> (<?php echo human_time_diff(get_the_modified_time('U'),current_time('U') ). ' ago '; ?>) <?php echo edit_post_link( __( $text_edit_post, THEMES_NAMES ), ' ', ' ' ); ?></em> </time><?php } ?>
	
	</div>
</div>
<style>
table.table.table-striped.table-borderless tr th {
	font-weight: bold !important;
	font-family: 'Roboto', sans-serif;
}

div.italic p em {
	font-family: 'Roboto', sans-serif; 
	font-style: oblique!important;
	font-size: 90%!important;
}
</style>
	  