Download modal window with a time delay - DLE Eglish

Download from the modal window with a time delay

This hack allows download files (Attachment) of the modal window with a time delay. The archive is ready file to overwrite.


Setting

- Open engine/modules/functions.php and find

$tpl->compile( 'attachment' );
  
  $replace_1[] = $tpl->result['attachment'];
  
  $tpl->result['attachment'] = str_replace( $row['name'], "\1", $tpl->result['attachment'] );
  
  $replace_2[] = $tpl->result['attachment'];
  
  $tpl->result['attachment'] = '';


-Replace:

$replace_1[] = "<div class="DownLoadWindow">
<div class="quote">            
<a href="#" onclick="showDownLoad(); return false;">Download <b>{$row['name']}</b></a>
</div>
</div>
<div id="DownLoadWindow" title="Download {$row['name']}" style="display:none;" >
  <table id="timer_1" border="0" cellpadding="2" cellspacing="2"><tbody><tr>  
  <td>Download will be available through:</td>  
  <td id="timer_num"></td>  
  <td>&#1089;&#1077;&#1082;.</td>  
 </tr></tbody></table>  
    <div style="display:none" id="timer_2">  
     Name: <b>{$row['name']}.</b><br /><br />
     Size: <b>{$size}.</b> <br /><br />
     Downloads: <b>{$row['dcount']} time.</b> <br /><br />
    <a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >Download <b>{$row['name']}</b></a></div>
</div>
<script type="text/javascript">

 timer_num = 15;  
 function timer_fc(){  
 if(timer_num>0){  
 $('#timer_num').text(timer_num);  
 timer_num--;  
 setTimeout("timer_fc()", 1000)  
 }else{  
 $('#timer_1').hide(); $('#timer_2').show();  
 }}  
 timer_fc();  

function showDownLoad() {
$(function(){
    $('#DownLoadWindow').dialog({
        width: 420,
        buttons: {
            "Close window" : function() {
                $(this).dialog("close");
            },
        }

    });
});
}
</script>";
            $replace_2[] = "<div class="DownLoadWindow">
<div class="quote">            
<a href="#" onclick="showDownLoad(); return false;">Download <b>{$row['name']}</b></a>
</div>
</div>
<div id="DownLoadWindow" title="Download {$row['name']}" style="display:none;" >
<table id="timer_1" border="0" cellpadding="2" cellspacing="2"><tbody><tr>  
  <td>Download will be available through:</td>  
  <td id="timer_num"></td>  
  <td>Sec.</td>  
 </tr></tbody></table>  
    <div style="display:none" id="timer_2">  
     Name: <b>{$row['name']}.</b><br /><br />
     Size: <b>{$size}.</b> <br /><br />
     downloads: <b>{$row['dcount']} time.</b> <br /><br />
    <a href="{$config['http_home_url']}engine/download.php?id={$row['id']}{$area}" >Download <b>{$row['name']}</b></a>
</div></div>
<script type="text/javascript">

 timer_num = 40; // The number of the delay in seconds  
 function timer_fc(){  
 if(timer_num>0){  
 $('#timer_num').text(timer_num);  
 timer_num--;  
 setTimeout("timer_fc()", 1000)  
 }else{  
 $('#timer_1').hide(); $('#timer_2').show();  
 }}  
 timer_fc();  

function showDownLoad() {
$(function(){
    $('#DownLoadWindow').dialog({
        width: 420,
        buttons: {
            "Close window" : function() {
                $(this).dialog("close");
            },
        }

    });
});
}
</script>";


Where in a row (timer_num = 40; // The number of the delay in seconds), specify the time delay

- In any file style.css (if this is not possible in any CSS file) at the end of file add:
#timer_num {width:70px; height:70px; background: url('../images/timer.gif') no-repeat; text-align:center; font-size:36px; color:#666}


-Throw timer.gif file in the images folder of your template.

About the Author

Saya bagian dari CKD (pesakit buah pinggang kronik) selama 8 thn. siapa-siapa nak bantu saya untuk biaya Injection.boleh email saya. Click Profile

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.