D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
vblioqus
/
safa777.info
/
wp-content
/
themes
/
infopediya
/
Filename :
template-download.php
back
Copy
<?php /** * The template for displaying all pages * Template Name: Download Page * @link https://codex.wordpress.org/Template_Hierarchy * @package Files_Custom_Theme */ get_header(); $postID = get_the_ID(); $custom_download_link = ''; $app_password = get_post_meta($postID, "infopediya_meta_file_password", true); $custom_download_link = get_post_meta($postID, "infopediya_meta_file_link", true); // if (isset($_GET['i'])) : // $postID = $_GET['i']; // $app_password = get_post_meta($postID, "infopediya_meta_file_password", true); // endif; // if (isset($_GET['l'])) : // $custom_download_link = $_GET['l']; // else : // $custom_download_link = get_post_meta($postID, "infopediya_meta_file_link", true); // endif; // meta box values $downloading_style = infopediya_downloading_style(); $timer_seconds = infopediya_dl_timer_seconds(); ?> <div id="primary" class="content-area container px-2"> <!-- ad widget --> <div class="col-md-12"> <?php if (is_active_sidebar('banner-dl-page-above')) : ?> <div class="ml-0 mr-0 bg-white" style="margin-bottom:5px; height: 330px !important;border-radius:5px !important;overflow:hidden;"> <?php dynamic_sidebar('banner-dl-page-above') ?> </div> <?php endif ?> </div> <!-- ad widget ends --> <div id="main" class="download-main pl-0 pr-0 col-lg-12 col-md-12 col-sm-12 col-xs-12"> <div class="download-header-banner row ml-0 mr-0 "> <?php dynamic_sidebar('banner-dl-header') ?> </div> <div class="download-post-row row ml-0 mr-0 mb-20"> <h1 class="text-center">Download the file</h1> <div class="post-title-row text-center row ml-0 mr-0 mt-10 mb-10"> <h2><?php echo get_the_title($postID) ?></h2> <?php if($downloading_style == 'option-1' || !$downloading_style) { ?> <div style="max-width:500px; margin-left:auto; margin-right:auto;"> <div class="progress my-3" id="progressbar-container"> <div id="progressbar" class="progress-bar gradient" role="progressbar" aria-valuenow="73" aria-valuemin="0" aria-valuemax="100" style=" transition: width 2s ease 0s;"> <span id="percentage"></span> </div> </div> </div> <?php } ?> <p class="container text-center my-2" id="downloading_info"> The download will start in <span id="view_timer"></span> seconds. </p> <div class="container text-center my-2" id="d-btn" style="display:none;"> <?php if ($custom_download_link): ?> <button onclick="download_app()" class="btn btn-primary py-2 px-4 gradient border-0"> <img width="16" height="16" src="<?php echo get_template_directory_uri() . '/icons/cloud.svg' ?>" alt="download-icon"> Download </button> <?php else: ?> <button class="btn btn-danger py-2 px-4 border-0"> <img width="16" height="16" src="<?php echo get_template_directory_uri() . '/icons/cloud.svg' ?>" alt="download-icon"> Sorry we can't find a downloadable file. </button> <?php endif; ?> </div> <?php if ($app_password) : ?> <div class="container text-center"> <label class="my-4 p-2 rounded border">Password: <?php echo esc_html($app_password) ?></label> </div> <?php endif ?> </div> </div> <!-- ad widget --> <div class="col-md-12"> <?php if (is_active_sidebar('banner-dl-page-below')) : ?> <div class="ml-0 mr-0 bg-white" style="margin-bottom:5px; height: 330px !important;border-radius:5px !important;overflow:hidden;"> <?php dynamic_sidebar('banner-dl-page-below') ?> </div> <?php endif ?> </div> <!-- ad widget ends --> <div class="similar-apps row ml-0 mr-0 mt-20 box-shadow"> <?php get_template_part('template-parts/similar', 'apps') ?> </div><!-- //Similar Apps --> </div> </div> <?php get_footer() ?> <script type="text/javascript"> var timer = <?php echo $timer_seconds; ?>; <?php if($downloading_style == 'option-1' || !$downloading_style) { ?> document.getElementById("downloading_info").style.display = 'none'; var bar_length = 100 / timer; var one_part = 100 / timer; var timeleft = 0; var downloadTimer = setInterval(function() { document.getElementById("progressbar").style.width = `${bar_length}%`; if (timeleft > <?php echo $timer_seconds ?>) { let p = document.getElementById("progressbar-container"); p.style.display = `none`; document.getElementById("d-btn").style.display = `block`; clearInterval(downloadTimer); } timeleft++; bar_length = bar_length + one_part; }, 1000); <?php } ?> <?php if($downloading_style == 'option-2') { ?> var downloadTimer = setInterval(function() { document.getElementById("view_timer").innerText = timer; if (timer == 0) { document.getElementById("downloading_info").style.display = 'none'; document.getElementById("d-btn").style.display = `block`; clearInterval(downloadTimer); } timer--; }, 1000); <?php } ?> <?php if($downloading_style == 'option-3') { ?> document.getElementById("downloading_info").style.display = 'none'; document.getElementById("d-btn").style.display = `block`; <?php } ?> function download_app() { window.location = '<?php echo esc_html($custom_download_link) ?>'; } </script>