Disable Auto count-down

admin4170

Member
Aug 8, 2014
30
0
6
Hi
I want disable countdown timer start automatically
I want a text link "Download", when user click on "Download" it will start counting down timer
Please help
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
Hi,

You can't do this via the config in the script although you can amend the code. I haven't tested this but it should work...

Open _download_page_compare_timed.inc.php (or whatever download page you are using)

Find and delete this line:

Code:
countdownTimer = setInterval('display()', 1000);
Regards,
Adam.
 

admin4170

Member
Aug 8, 2014
30
0
6
Resolved!
But other problem
When countdown complete, must click on "download now" link to redirect to catpcha page
How to auto redirect to catpcha page?
Thanks
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
For anyone else, this is the full amended javascript code at the top of _download_page_compare_timed.inc.php:

Code:
<script>
    <!--
    var milisec = 0;
    var seconds = <?php echo (int)$additionalSettings['download_wait']; ?>;
	var countdownTimer = null;
	
    function display()
    {
		if(countdownTimer == null)
		{
			countdownTimer = setInterval('display()', 1000);
		}
        $('.btn-free').hide();
        $('.download-timer').show();
        if (seconds == 0)
        {
            $('.download-timer').html("<a href='<?php echo safeOutputToScreen($file->getNextDownloadPageLink()); ?>'><?php echo pluginHelper::pluginEnabled('mediaplayer') ? t("download_view_now", "download/view now") : t("download_now", "download now"); ?></a>");
        }
        else
        {
            $('.download-timer-seconds').html(seconds);
        }
        seconds--;
    }

    $(document).ready(function() {
        $('.download-timer-seconds').html(<?php echo (int)$additionalSettings['download_wait']; ?>);
    });
    -->
</script>
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
Enable the captcha page via the site settings in the admin area.
 

admin4170

Member
Aug 8, 2014
30
0
6
I known but my mean
After countdown completely, it will redirect to catpcha page automatically, don't need click "download now"
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
It's not possible via the script config. You'll need to amend the javascript I listed above. I don't know what it would be off hand sorry.