<?php
global $wpdb, $post, $wp_query, $opt_themes;
$linkvar = ( get_query_var( 'link' ) ) ? get_query_var( 'link' ) : false;
$download_links = get_post_meta(get_the_ID(), 'repeatable_fields', true);

foreach ($download_links as $getlinks => $dw) {
		 
	if ( !empty($dw['name']) ) {
	$name = $dw['name'];
	} elseif ( !empty($dw['title']) ) {
	$name = $dw['title'];
	} 
	
	if ( $linkvar ) {
	if ( ( $linkvar == ( (int) $getlinks + 1 ) ) ) {
		$app_name = $name;  
	}}
} 
ob_start();
get_header();
$the_title	= get_the_title(); 
$t_download	= $opt_themes['text_19']; 
$header = ob_get_clean();
$header = preg_replace('#<title>(.*?)<\/title>#', '<title>'.$t_download.' '.$app_name.'</title>', $header);
echo $header;

error_reporting(0);
global $wpdb, $post, $wp_query, $opt_themes;
function mask_link( $string, $action = 'e' ){
$secret_key	= THEMES_NAMES;
$secret_iv	= EXTHEMES_AUTHOR;
$output	= false;
$encrypt_method	= "AES-256-CBC";
$key	= hash( 'sha256', $secret_key );
$iv	= substr( hash( 'sha256', $secret_iv ), 0, 16 );
if( $action == 'e' ){
	$output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
} else if( $action == 'd' ){
	$output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );
}
return $output;
}
$file_path	= $_GET['urls'];
$file_name	= $_GET['names'];
$host	= ''.$_SERVER['HTTP_HOST'].'';
$permalink	= get_the_permalink();
$urls	= $_GET['urls'];  
$urlsx	= str_replace($permalink.'/file/?urls=', '', $urls);
$namesapks	= $_GET['names'];
$sizeapks	= $_GET['sizes'];
$names	= $_GET['names'];
 

$file_path1	= mask_link($file_path); 
$file_path2	= mask_link($file_path, 'd');
$version	= get_post_meta( $post->ID, 'wp_version_GP', true );
$versionX1	= get_post_meta( $post->ID, 'wp_version_GP', true );
$versionX	= '-';
if ( $version === FALSE or $version == '' ) $version = $versionX1;
$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;
$timers_counts	= $opt_themes['download_waits_timers_'];
$size3	= get_post_meta(get_the_ID(), 'wp_sizedownloadlink2', true);
$tipe3	= get_post_meta(get_the_ID(), 'wp_typedownloadlink2', true);
$tipedownload3	= get_post_meta(get_the_ID(), 'wp_typedownloadlink2', true); 
$text_latest_update	= $opt_themes['text_latest_update'];
$text_post_on	= $opt_themes['text_post_on'];
$text_edit_post	= $opt_themes['text_edit_post'];
 
?>
<script type='text/javascript'>
   //<![CDATA[
	var blog	= document.location.hostname;
	var slug	= document.location.pathname;
	var ctld	= blog.substr(blog.lastIndexOf("."));
	var currentURL	= location.href;
	var currentURLs	= "<?php echo $app_link; ?>";
	var str	= currentURLs; 
	var res	= str.replace("/?url=", "");
   $(".Visit_Link").hide();
   function changeLink(){
       var decodedString = res;
       window.open(decodedString,'_top')
   }
   function generate() {
       var notifx	= document.getElementById("notifx"),
	 linkDL	= document.getElementById("download"),
           linkAL	= document.getElementById("download2"),
           btn	= document.getElementById("btn"),
           notif	= document.getElementById("daplong"),
           direklink	= document.getElementById("download").href,
           waktu	= <?php echo $timers_counts; ?>;
       var teks_waktu	= document.createElement("span");
       linkDL.parentNode.replaceChild(teks_waktu, linkDL);
       var id;
       id = setInterval(function () {
           waktu--;
           if (waktu < 0) {
               teks_waktu.parentNode.replaceChild(linkDL, teks_waktu);
               clearInterval(id);
               notifx.style.display = "none";
               /* linkDL.style.display = "inline";
               linkAL.style.display = "inline"; */
           } else {
               teks_waktu.innerHTML = "<div id='download-loading' class='my-4' ><p class='text-center text-muted mb-2'><?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> " + waktu.toString() + " <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>...</p><div class='progress'><div class='progress-bar progress-bar-striped progress-bar-animated bg-secondary' role='progressbar' aria-valuenow='0' aria-valuemin='0' aria-valuemax='100' style='width: " + waktu.toString() + "0%'></div></div></div>";
               btn.style.display = "none";
           }
       }, 1000);
   }
   //]]>
</script>
<?php
global $wpdb, $post, $wp_query, $opt_themes;
$colors	= $opt_themes['color_link'];  
$title_ps	= get_post_meta( $post->ID, 'wp_title_GP', true );

?>

<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css' rel='stylesheet'/>
<style>
.grid-line{display:none}.grid-header-text-box{display:block;max-height:18px;overflow:hidden;text-transform:uppercase;position:relative;width:90%}.grid-header-text-box:after{content:'\a0';height:1px;width:100%;background-color:rgba(0,0,0,0.24);position:absolute;top:9.5px}.grid-header-text-box a{text-decoration:none;font-size:12px;color:#525252;padding:0 6px;font-family:arial,sans-serif;font-weight:normal;height:15px;background-color:rgba(255,255,255,0.7);border-radius:2px}.columns-1 .grid-bottom-border{margin-left:6px;margin-right:6px;width:348px;height:1px;background-color:rgba(0,0,0,0.24);margin-top:3px;margin-bottom:3px}.grid-link .ats{position:absolute;right:8px;opacity:1.0;background-color:#fff}.grid-link .ats svg{height:16px;width:16px;margin-top:auto;margin-bottom:auto;display:block}.grid-link .ats svg path{fill:<?php echo $colors; ?>}.grid-link:hover .ats{background-color:<?php echo $colors; ?>}.grid-link:hover .ats svg path{fill:#fff}.grid-link{position:relative}.grid-header-text-box a{font-family:roboto,sans-serif;letter-spacing:.8px;font-weight:500}.button1{content:'\00bb';background-color:#4caf50;border:0;color:white;padding:10px 22px;text-align:center;text-decoration:none;display:inline-block;width:85%;font-size:17px;margin:4px 2px;-webkit-transition-duration:.4s;transition-duration:.4s;cursor:pointer}.button21{background-color:<?php echo $colors; ?>!important;color:white!important;border:1px solid white!important;border-radius:25px}.button21:hover{background-color:white!important;color:<?php echo $colors; ?>!important;border:1px solid white!important;border-radius:25px}.six-sec-ease-in-out{-webkit-transition:width 6s ease-in-out;-moz-transition:width 6s ease-in-out;-ms-transition:width 6s ease-in-out;-o-transition:width 6s ease-in-out;transition:width 6s ease-in-out}.aplication-page1,.aplication-single1,.page-woocommerce1{width:100%;max-width:100%}.aplication-page1 .box1,.aplication-single1 .box1{background:#fff;box-shadow:2px 2px 2px 0 #d2d1d1;padding:20px 25px;margin-bottom:20px}.aplication-page1 .box1 h1.box-title{text-transform:initial;font-size:27px;margin:0;padding:0;padding-bottom:10px;margin-bottom:15px;color:#444}.aplication-page1 .box1 h1.box-title::after{left:0;background:<?php echo $colors; ?>}.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}#subheader.np{display:none!important}span.align-middle.moddroid {color: white !important;}@media (max-width:400px){#hiddens{display:none!important}.hiddens{display:none!important}}
 .svg-6 {
	width: 1.25rem;
	height: 1.25rem; 
	}

</style>


<?php
require get_template_directory().'/libs/addons/inc/shortlink.php';
$link_param = get_query_var('link') ? (int) get_query_var('link') : 0;
$post_id    = get_the_ID();

/* $downloads = get_post_meta($post_id, 'group_downloads_links', true);
if ( ! is_array($downloads) || empty($downloads) ) {
    $downloads = get_post_meta($post_id, 'repeatable_fields', true);
} */

$downloads = get_post_meta($post_id, 'repeatable_fields', true);

if ( is_array($downloads) && ! empty($downloads) ) {
    // Reset variables
    $app_link = $app_name = $app_size = $app_type = $app_note = '';

    foreach ( $downloads as $index => $item ) {
        // We want 1-based matching from URL (?link=1 → first item)
        if ( ($index + 1) === $link_param ) {
            $app_link = ! empty($item['url'])   ? $item['url']   : ( ! empty($item['links']) ? $item['links'] : '' );
            $app_name = ! empty($item['name'])  ? $item['name']  : ( ! empty($item['title']) ? $item['title'] : '' );
            $app_size = ! empty($item['size'])  ? $item['size']  : 
                        ( ! empty($item['sizes']) ? $item['sizes'] : 
                        ( ! empty($item['sizes1'])? $item['sizes1'] : '' ));
            $app_type = ! empty($item['type'])  ? $item['type']  : 
                        ( ! empty($item['tipe'])  ? $item['tipe']  : 
                        ( ! empty($item['tipes']) ? $item['tipes'] : '' ));
            $app_note = ! empty($item['notes']) ? $item['notes'] : '';

            break; // found → no need to continue loop
        }
    }
}

	$original_url = esc_url_raw($app_link);

	// Ambil setting dari Redux
	$enable_auto = isset( $opt_themes['shortlink_dw'] ) ? $opt_themes['shortlink_dw'] : false;
	$service     = isset( $opt_themes['auto_shortlink'] ) ? $opt_themes['auto_shortlink'] : 'ouo_sl';

	// Jika fitur Automatic Short Links MATI → langsung pakai URL asli
	if ( ! $enable_auto ) {
	$shortened_url = $original_url;
	} else {
	// Fitur AKTIF → proses sesuai service yang dipilih
	switch ( $service ) {
	case 'ouo_sl':
	$shortened_url = ouo_io_user( $app_link );
	break;

	case 'shrinkearn_sl':
	$shortened_url = shrinkearn_user( $app_link );
	break;

	case 'paid4link_sl':
	$shortened_url = paid4link_user( $app_link );
	break;

	case 'adurl_sl':
	$shortened_url = adurl_user( $app_link );
	break;

	default:
	$shortened_url = $app_link; // fallback jika service tidak dikenali
	break;
	}
	}
	 
	// Pastikan URL akhir valid
	$link_url = esc_url($shortened_url) ?: $original_url;
?>
			
			
<div id="content post-id-<?php the_ID(); ?>" class="site-content mt-1" > 

	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?> 
	
	<div class="container" >  
	<div class="">
	<main id="primary" class="content-area mx-auto detail" style="">
	<?php 
	//sp_single_row();
	//sp_main();
	sp_article();
	sp_breadcrum();
	 
	break; 	
	case 'modyolo':
	?>
	<div class="container" >  
	<?php 
	sp_single_row();
	sp_main();
	sp_article();
	sp_breadcrum();
	 
	break; 	
	case 'reborn':
	?>
	<div class="container" >  
	<?php 
	sp_single_row();
	sp_main();
	sp_breadcrum();
	sp_article();
	 
	break; 	
	case 'liteapks':
	?>
	 
	<div class="container py-4">
	<div class="row">
	<main id="primary" class="col-12 col-lg-8 col-xl-9 content-area">
	<?php 	
	sp_breadcrum();
	?>
	<article class="bg-white border rounded shadow-sm p-3 mb-4">
	<?php	 
	break; 
	default:
	?>
	<div class="container" >  
	<?php 
	sp_breadcrum();
	sp_single_row();
	sp_main();
	sp_article();
	?>
	<?php
	break; 
	}
	?>
	 

	<div class="pb-3 pt-3 entry-content">

	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<div class="mt-3">
    <div class="d-flex mb-3 mb-md-4 download-gamex" style=" align-items: center ">
        <div class="flex-shrink-0 mr-3 download-game-icon">		  
		<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['no_img']['url']; } ?>" class="rounded " alt="<?php the_title(); ?>" > 

        </div>
        <div class="download_game--info">
            <h1 class="lead font-weight-semibold">
            <?php if ($app_name) { ?><?php echo trim(strip_tags($app_name)); ?><?php } else { ?><?php echo ucwords($title_ps); ?> v<?php echo $version; ?><?php } ?>
            </h1>
            <p class="mobile_download--info hidden">Version: <?php echo $version; ?></p>
            <?php if($app_size){?><p class="mobile_download--info hidden">Size: <?php echo $app_size; ?></p><?php } ?>
			<?php if (get_post_meta( $post->ID, 'wp_mods', true )) { ?>
			<?php
			$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;
			?>
			<p class="mobile_download--info hiddenz" style="display: inline-block;  max-width: 14em;  overflow: hidden;  text-overflow: ellipsis;  white-space: nowrap;"><?php echo trim(strip_tags($wp_mods)) ?></p><?php } ?> 
        </div>
    </div>
	</div>
	<?php
	break; 
	
	case 'modyolo':
	?>
	<div class="text-center">
	<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 mb-3" alt="<?php the_title(); ?>" >  
	 
	<h1 class="h5 font-weight-semibold mb-3" ><?php if ($app_name) { ?><?php echo trim(strip_tags($app_name)); ?><?php } else { ?><?php echo ucwords($title_ps); ?> v<?php echo $version; ?><?php } ?></h1> 
	</div>
	<?php
	break; 
	
	case 'reborn':
	get_template_part('include/single/background'); 
	?> 
	<h1 class="h5 font-weight-semibold mb-3" ><?php if ($app_name) { ?><?php echo trim(strip_tags($app_name)); ?><?php } else { ?><?php echo ucwords($title_ps); ?> v<?php echo $version; ?><?php } ?></h1> 
	 
	<?php
	break; 
	
	case 'liteapks': 
	?> 
	<div class="text-center">
	
	<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 mb-3" alt="<?php the_title(); ?>" >  
	 
	<h1 class="h5 font-weight-semibold mb-3" ><?php if ($app_name) { ?><?php echo trim(strip_tags($app_name)); ?><?php } else { ?><?php echo ucwords($title_ps); ?> v<?php echo $version; ?><?php } ?></h1> 
	</div>
	 
	
	<?php
	break; 
	
	default:
	?>
	<h1 class="h5 font-weight-semibold" ><?php if ($app_name) { ?><?php echo trim(strip_tags($app_name)); ?><?php } else { ?><?php echo ucwords($title_ps); ?> v<?php echo $version; ?><?php } ?></h1>
	<?php
	break;
	} ?> 

		
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	 
	<p class="text-muted" style="display:none">
	<noscript>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_download_times_notice_5'], TEXT_DOMAIN); ?><em><strong> <?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <br>
	</noscript>
	<?php if (get_post_meta( $post->ID, 'wp_mods', true )) { ?>
	<?php
	$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;
	?>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_MODAPK'], TEXT_DOMAIN); ?> <?php echo trim(strip_tags($wp_mods)) ?>
	<?php } else { ?><?php } ?> 
	</p>
	<p><?php _e($opt_themes['exthemes_download_thanks'], TEXT_DOMAIN); ?> <em><strong><?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <?php _e($opt_themes['exthemes_download_site'], TEXT_DOMAIN); ?></p>   
	<?php
	break; 
	
	case 'modyolo':
	?>
	
	<?php
	break; 
	
	case 'reborn':
	?>
	<p class="text-muted">
	<noscript>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_download_times_notice_5'], TEXT_DOMAIN); ?> <em><strong> <?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <br>
	</noscript>
	<?php if (get_post_meta( $post->ID, 'wp_mods', true )) { ?>
	<?php
	$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;
	?>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_MODAPK'], TEXT_DOMAIN); ?> <?php echo trim(strip_tags($wp_mods)) ?>
	<?php } else { ?><?php } ?> 
	</p>
	<p><?php _e($opt_themes['exthemes_download_thanks'], TEXT_DOMAIN); ?> <em><strong><?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <?php _e($opt_themes['exthemes_download_site'], TEXT_DOMAIN); ?></p>   
	<?php
	break; 
	
	case 'liteapks':
	?>
	 
	
	<?php
	break; 
	
	default:
	?>
	<?php if(is_rtl()){ ?><div style="clear:both;"></div><?php } else{ ?><?php } ?>
	<p class="text-muted">
	<noscript>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_download_times_notice_5'], TEXT_DOMAIN); ?> <em><strong><?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <br>
	</noscript>
	<?php if (get_post_meta( $post->ID, 'wp_mods', true )) { ?>
	<?php
	$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;
	?>
	<span style="color: <?php echo $colors; ?>">*</span> <?php _e($opt_themes['exthemes_MODAPK'], TEXT_DOMAIN); ?> <?php echo trim(strip_tags($wp_mods)) ?>
	<?php } else { ?><?php } ?> 
	</p>
	<p><?php _e($opt_themes['exthemes_download_thanks'], TEXT_DOMAIN); ?> <em><strong><?php echo esc_html( get_post_meta( $post->ID, 'wp_title_GP', true ) ); ?></strong></em> <?php _e($opt_themes['exthemes_download_site'], TEXT_DOMAIN); ?></p>   
	<?php
	break;
	} ?> 

	
	


	</div>
	<div class="mb-3">   
	<?php ex_themes_banner_single_ads_download(); ?>
	</div> 
	
	
		
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>	
	<p class='text-center text-muted mb-2'><span class="waitme" ></span></p>
	<div id="progress_new" class="progress_new"><div id="value" class="progress_new-value"> </div></div>
	<?php
	break; 
	
	case 'modyolo':
	?>	
	<div id="loading_wait" class="rounded text-center p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<p class='text-center text-muted mb-2'><span class="waitme"></span></p>
	<div  id="progress_new" class="progress">
	<div class="progress-bar progress-bar-striped progress-bar-animated bg-primary" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
	</div>
	</div>
	<?php
	break; 
	
	case 'reborn':
	?>
	<div id="loading_wait" class="rounded text-center p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<p class='text-center text-muted mb-2'><span class="waitme"></span></p>
	<div  id="progress_new" class="progress">
	<div class="progress-bar progress-bar-striped progress-bar-animated bg-primary" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
	</div>
	</div>
	
	<?php
	break; 
	
	case 'liteapks':
	?>
	<div id="loading_wait" class="rounded text-center p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<p class='text-center text-muted mb-2'><span class="waitme"></span></p>
	<div id="progress_new" class="progress">
	<div class="progress-bar progress-bar-striped progress-bar-animated bg-primary" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%"></div>
	</div>
	</div>
	
	<?php
	break; 
	
	default:
	?> 
	<div id="progress_new" class="progress_new"><div id="value" class="progress_new-value"> </div></div>
	<?php
	break;
	} ?> 


	

	

	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>	
	<div id="download" class="text-center mb-4" style="display: block;">
	<a id="no-link" class="btn btn-secondary px-5" href="<?php echo $link_url; ?>" onclick="changeLink()" download><?php if($opt_themes['svg_icon_downloadx']) { ?><?php echo $opt_themes['svg_icon_downloadx']; ?><?php } ?><span class="align-middle moddroid" ><?php _e($opt_themes['exthemes_Download'], TEXT_DOMAIN); ?> <?php if(!empty($app_size)){ echo '('.$app_size.')'; } ?> </span></a>
	</div>
	
	<?php
	break; 
	
	case 'modyolo':
	?>
	<div id="download" class="rounded text-center p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<a id="no-link" class="btn btn-primary px-5 download" href="<?php echo $link_url; ?>" onclick="changeLink()" download><?php if($opt_themes['svg_icon_downloadx']) { ?><?php echo $opt_themes['svg_icon_downloadx']; ?><?php } ?><span class="align-middle moddroid" ><?php _e($opt_themes['exthemes_Download'], TEXT_DOMAIN); ?> <?php if(!empty($app_size)){ echo '('.$app_size.')'; } ?></span> </a>
	</div>
	<?php
	break; 
	
	case 'liteapks':
	?>
	<div id="download" class="rounded text-center bg-light p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<a id="no-link" class="btn btn-primary px-5 download" href="<?php echo $link_url; ?>" onclick="changeLink()" download><?php if($opt_themes['svg_icon_downloadx']) { ?><?php echo $opt_themes['svg_icon_downloadx']; ?><?php } ?><span class="align-middle moddroid" ><?php _e($opt_themes['exthemes_Download'], TEXT_DOMAIN); ?> <?php if(!empty($app_size)){ echo '('.$app_size.')'; } ?></span></a>
	</div>
	<style>
	.svg-5 {
	width: 1.25rem;
	height: 1.25rem;
	fill: white;
	}
	</style>
	<?php
	break; 
	
	case 'reborn':
	?>
	<div id="download" class="rounded text-center p-3 mb-3" style="display: block; background-color: var(--color_rgb_button);" >
	<a id="no-link" class="btn btn-primary px-5 download" href="<?php echo $link_url; ?>" onclick="changeLink()" download><?php if($opt_themes['svg_icon_downloadx']) { ?><?php echo $opt_themes['svg_icon_downloadx']; ?><?php } ?><span class="align-middle moddroid" ><?php _e($opt_themes['exthemes_Download'], TEXT_DOMAIN); ?> <?php if(!empty($app_size)){ echo '('.$app_size.')'; } ?></a></span>
	</div>
	<style>
	.svg-5 {
	width: 1.25rem;
	height: 1.25rem;
	fill: white;
	}
	</style>
	<?php
	break; 
	
	default:
	?>
	<div id="download" class="text-center mb-4" style="display: block;">
	<a id="no-link" class="btn btn-secondary px-5" href="<?php echo $link_url; ?>" onclick="changeLink()" download><?php if($opt_themes['svg_icon_downloadx']) { ?><?php echo $opt_themes['svg_icon_downloadx']; ?><?php } ?><span class="align-middle moddroid" ><?php _e($opt_themes['exthemes_Download'], TEXT_DOMAIN); ?></span> <?php if(!empty($app_size)){ echo '('.$app_size.')'; } ?></a>
	</div>
	
	<?php
	break;
	} ?> 
 
	
	<p id="notifx" class="text-center mb-4"><?php _e($opt_themes['exthemes_download_times_notice_3'], TEXT_DOMAIN); ?>, <a id="download" href="<?php echo $link_url; ?>" target="_top"><svg class="svg-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"></path></svg> <span><?php _e($opt_themes['exthemes_download_times_notice_4'], TEXT_DOMAIN); ?></span></a></p>
 
	<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
	<script type="text/javascript">
	//$('a#no-link[href]').each(function (e) {
	//var hash = $(this).attr('href');
	//$(this).removeAttr('href').css('cursor', 'pointer');
	//location.hash = hash;
	//});
	</script>  
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<script type="text/javascript">
	var downloadButton	= document.getElementById("download");
	var notif	= document.getElementById("notifx");
	var progress_new	= document.getElementById("progress_new");
	var loading_wait	= document.getElementById("loading_wait");
	var counter	= <?php echo $timers_counts; ?>;
	var newElement	= document.createElement("p");
	var progressval	= <?php echo $timers_counts; ?>;
	var waitmes	= document.getElementsByClassName('waitme')[0];
	
	newElement.innerHTML = "";
	var id;
	downloadButton.parentNode.replaceChild(newElement, downloadButton);
	id	= setInterval(function() {
	counter--;
	
	if(counter < 0) {
	newElement.parentNode.replaceChild(downloadButton, newElement);
	clearInterval(id);
	notif.style.display	= "none";
	progress_new.style.display	= "none";
	//loading_wait.style.display	= "none";
	waitmes.style.display	= "none";

	} else {
	waitmes.innerText = "<?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> "+counter.toString()+" <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>"; 
	 
	}
	}, 900);

	</script>  
	<?php
	break; 
	
	case 'modyolo':
	?>
	<script type="text/javascript">
	var downloadButton	= document.getElementById("download");
	var notif	= document.getElementById("notifx");
	var progress_new	= document.getElementById("progress_new");
	var loading_wait	= document.getElementById("loading_wait");
	var counter	= <?php echo $timers_counts; ?>;
	var newElement	= document.createElement("p");
	var progressval	= <?php echo $timers_counts; ?>;
	var waitmes	= document.getElementsByClassName('waitme')[0];
	
	newElement.innerHTML = "";
	var id;
	downloadButton.parentNode.replaceChild(newElement, downloadButton);
	id	= setInterval(function() {
	counter--;
	
	if(counter < 0) {
	newElement.parentNode.replaceChild(downloadButton, newElement);
	clearInterval(id);
	notif.style.display	= "none";
	progress_new.style.display	= "none";
	loading_wait.style.display	= "none";
	waitmes.style.display	= "none";

	} else {
	waitmes.innerText = "<?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> "+counter.toString()+" <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>"; 
	 
	}
	}, 900);

	</script> 
	<?php
	break; 
	
	case 'reborn':
	?>
	<script type="text/javascript">
	var downloadButton	= document.getElementById("download");
	var notif	= document.getElementById("notifx");
	var progress_new	= document.getElementById("progress_new");
	var loading_wait	= document.getElementById("loading_wait");
	var counter	= <?php echo $timers_counts; ?>;
	var newElement	= document.createElement("p");
	var progressval	= <?php echo $timers_counts; ?>;
	var waitmes	= document.getElementsByClassName('waitme')[0];
	
	newElement.innerHTML = "";
	var id;
	downloadButton.parentNode.replaceChild(newElement, downloadButton);
	id	= setInterval(function() {
	counter--;
	
	if(counter < 0) {
	newElement.parentNode.replaceChild(downloadButton, newElement);
	clearInterval(id);
	notif.style.display	= "none";
	progress_new.style.display	= "none";
	loading_wait.style.display	= "none";
	waitmes.style.display	= "none";

	} else {
	waitmes.innerText = "<?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> "+counter.toString()+" <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>"; 
	 
	}
	}, 900);

	</script> 
	
	<?php
	break; 
	
	case 'liteapks':
	?>
	<script type="text/javascript">
	var downloadButton	= document.getElementById("download");
	var notif	= document.getElementById("notifx");
	var progress_new	= document.getElementById("progress_new");
	var loading_wait	= document.getElementById("loading_wait");
	var counter	= <?php echo $timers_counts; ?>;
	var newElement	= document.createElement("p");
	var progressval	= <?php echo $timers_counts; ?>;
	var waitmes	= document.getElementsByClassName('waitme')[0];
	
	newElement.innerHTML = "";
	var id;
	downloadButton.parentNode.replaceChild(newElement, downloadButton);
	id	= setInterval(function() {
	counter--;
	
	if(counter < 0) {
	newElement.parentNode.replaceChild(downloadButton, newElement);
	clearInterval(id);
	notif.style.display	= "none";
	progress_new.style.display	= "none";
	loading_wait.style.display	= "none";
	waitmes.style.display	= "none";

	} else {
	waitmes.innerText = "<?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> "+counter.toString()+" <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>"; 
	 
	}
	}, 900);

	</script> 
	
	<?php
	break; 
	
	default:
	?>
	<script type="text/javascript">
	var downloadButton	= document.getElementById("download");
	var notif	= document.getElementById("notifx");
	var progress_new	= document.getElementById("progress_new");
	var loading_wait	= document.getElementById("loading_wait");
	var counter	= <?php echo $timers_counts; ?>;
	var newElement	= document.createElement("p");
	var progressval	= <?php echo $timers_counts; ?>;
	var waitmes	= document.getElementsByClassName('waitme')[0];
	
	newElement.innerHTML = "";
	var id;
	downloadButton.parentNode.replaceChild(newElement, downloadButton);
	id	= setInterval(function() {
	counter--;
	
	if(counter < 0) {
	newElement.parentNode.replaceChild(downloadButton, newElement);
	clearInterval(id);
	notif.style.display	= "none";
	progress_new.style.display	= "none";
	//loading_wait.style.display	= "none";
	waitmes.style.display	= "none";

	} else {
	waitmes.innerText = "<?php _e($opt_themes['exthemes_download_times_notice_1'], TEXT_DOMAIN); ?> "+counter.toString()+" <?php _e($opt_themes['exthemes_download_times_notice_2'], TEXT_DOMAIN); ?>"; 
	 
	}
	}, 900);

	</script> 
	
	<?php
	break;
	} ?> 

	<style>
	.progress_new{display:block;width:100%;max-width:100%;margin:1em auto;padding:5px;border:0;background:#fff;border-radius:14px;box-shadow:inset 0 0 0 transparent,0 1px 0 rgba(255,255,255,.2)}.progress_new-value{width:0;height:20px;background:#fff linear-gradient(to right,var(--color_text),var(--color_button));border-radius:10px;box-shadow:inset 0 0 0 transparent,0 0 0 0 transparent;-webkit-animation:loading <?php echo $timers_counts; ?>s linear;animation:loading <?php echo $timers_counts; ?>s linear}@-webkit-keyframes loading{0%{width:0}80%{width:80%}100%{width:100%}}@keyframes loading{0%{width:0}80%{width:80%}100%{width:100%}}	
	</style>
	 
	<?php get_template_part('include/telegram'); ?>
	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	?>
	<?php get_template_part('include/info_rating'); ?> 
	<?php ex_themes_banner_single_ads_download_2_(); ?> 
	<?php if ( shortcode_exists( 'rns_reactions' ) ) { ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?>
	<?php } ?>  
	<?php
	break; 	
	case 'modyolo':
	?>
	<?php get_template_part('include/info_rating'); ?> 
	<?php ex_themes_banner_single_ads_download_2_(); ?> 
	<?php if ( shortcode_exists( 'rns_reactions' ) ) { ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?>
	<?php } ?>  
	
	<?php
	break; 	
	case 'reborn':
	?>
	<?php get_template_part('include/info_rating'); ?> 
	<?php ex_themes_banner_single_ads_download_2_(); ?> 
	<?php if ( shortcode_exists( 'rns_reactions' ) ) { ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?>
	<?php } ?>  
	
	<?php
	break; 	
	case 'liteapks':
	?>
	
	<?php	
	break; 
	default:
	?>
	<?php get_template_part('include/info_rating'); ?> 
	<?php ex_themes_banner_single_ads_download_2_(); ?> 
	<?php if ( shortcode_exists( 'rns_reactions' ) ) { ?>
	<?php echo do_shortcode( '[rns_reactions]' ); ?>
	<?php } ?>  
	
	<?php
	break; 
	}
	?>
	
	 
	<?php switch ($opt_themes['themes_styles']) { case 'liteapks': ?>
	</article> 
	<?php break; } ?>
	 
	<?php 
	sp_close_article(); 
	get_template_part('template/info.download');
	ex_themes_related_posts_(); ?>
	</main>
	
	
	
	<?php 
	switch($opt_themes['themes_styles']){
	case 'moddroid':
	//do_action('single_sidebar');
	break; 
	
	case 'modyolo':
	do_action('single_sidebar');
	break; 
	
	case 'reborn':
	 
	break; 
	
	default:
	do_action('single_sidebar');
	break;
	}
	?>  
	
	<?php sp_close_single_row(); ?> 
	 
</div>
</div>
  
 


    
<?php if($opt_themes['activate_no_links_']){ ?> 
<script>
//<![CDATA[
var uri=window.location.toString();if(uri.indexOf("/file/","/file/")>0){var clean_uri=uri.substring(0,uri.indexOf("/file/"));window.history.replaceState({},document.title,clean_uri)}
//]]>
</script>
<?php }
get_footer(); 