PDA

View Full Version : Please Read, Need Download Script



mkvelidadon
04-28-2006, 04:38 AM
I wanted a download script such as a conter script, like if somebody clicks on a download link a pop shows up telling them to wait 30 seconds (and shows a graphical status bar or shows how many seconds left) and when time counts down the link appears, sort of like the timeout code RapdiShare/Megaupload have.

I had a similar script quite some time ago but I shut down the site without backing up the code, :mad:

It was something like this:

<script>var c = 58; fc(); function fc(){
if(c>0){document.getElementById("dl").innerHTML = "Please Wait For Link To Load".</script>

<!-- hide
function timer(url) {
setTimeout("print();", 10000);
}

// -->

<!-- hide

function print(url) {
document.getElementById("dl").innerHTML = unescape('AFTER TIMEOUT IS DONE');

}

// -->

</script>

Thanks!!!!!

djr33
04-28-2006, 04:51 AM
What possible reason? That sounds like an awful plan.

"I want it to look like I'm like those idiotic hosting companies"

No offense, but I just don't get this.

If you can just let people download, what possible reason would you have for not letting them do so? The other companies are 1. trying to get money or 2. waiting for servers to be ready.

In short, you could make a page that counts (not too hard, but not sure exactly how, myself) and use a meta refresh tag.
<meta http-equiv="refresh" content="30;url=http://nextpage.com/">
That 30 will make it take 30 seconds for it to refresh to the next page.
(note: must go between the <head> and </head> commands on your page)

Easy to get around, but so would be any JS.

Plus, the above ISN'T JS, so it's totally compatible.


And there are a couple 'loading bar' scripts on DD. Just look to see if any work for you.

mkvelidadon
04-28-2006, 05:32 AM
because they kill my bandwidth and I want the people to know how long they still need to wait for before the link shows up :)

mkvelidadon
06-23-2006, 03:30 AM
please guys i need it, and here it is again with the javascript mr professor:

<script language="JavaScript">

<!-- hide
function timer(url) {
setTimeout("print();", 10000);
}

// -->

<!-- hide

function print(url) {
document.getElementById("dl").innerHTML = unescape('<p align="center">AFTERTIMEOUT</a></p>');

}

// -->

</script>

tech_support
06-23-2006, 03:55 AM
Try:



<script>
var waitnum = 60
var nextloc = "wherever.htm"
function waitForDownload(){
if (waitnum==0) {
document.getElementById("wait").innerHTML = "Downloading File..."
window.location=nextloc
}
else {
waitnum--
document.getElementById("wait").innerHTML = "Please wait "+waitnum+" to complete the download"
}
}
setInterval("waitForDownload()",1000)
</script>

and...


<div id="wait"></div>


Note: Haven't tried it yet

mkvelidadon
06-23-2006, 04:23 AM
thanks alot worked great!