New messages Members Forum rules Search
  • Page 1 of 1
  • 1
Forum moderator: kostova  
uCoz Support Forum by uCozers » uCoz » General Questions » I want guests to wait 30 secs before they can download (sml[Default])
I want guests to wait 30 secs before they can download
UniqueDate: Sunday, 2009 August 30, 9:26 PM | Message # 1
Font size: A | A |
Private
Group: User
Message: 19
[ ]
Offline
On my site i have mp3 for download in site catalog and i want to guest must wait example 30 secs before he goes to download the song as on RS or HotFile ... it is possible ? smile
 
BrazenDate: Sunday, 2009 August 30, 11:42 PM | Message # 2
Font size: A | A |
Colonel
Group: Administrator
Message: 304
[ ]
Offline
Paste this code in the top part of your website:
Code
<script type="text/javascript">
<!--
var count=30;
var obj;
window.onload=function() {
obj=document.getElementById('delayed');
obj.onclick=function() {
if(count<=0) {
return true;
}
else {
if(count==30) {
waitForIt();
return false;
}
else {
return false;
}
}
}
}
function waitForIt() {
obj.firstChild.data='Link will be available after '+count+'secs';
if(count<=0) {
clearTimeout(cd);
obj.firstChild.data='Click here to Download';
obj.className='go';
return;
}
count--;
cd=setTimeout('waitForIt()',1000);
}
//-->
</script>

And add this code where you want your download link to appear:

Code
<div>
<a id="delayed" class="stop" href="http://www.epiclosers.com/">Download (30sec)</a>
</div>



Source http://www.codingforums.com/archive/index.php/t-96853.html


LOL With Us! l Game Blog l 3D Autos

"knowledge without wisdom is curse" Alex Seb

 
UniqueDate: Monday, 2009 August 31, 12:35 PM | Message # 3
Font size: A | A |
Private
Group: User
Message: 19
[ ]
Offline
It`s work but i want only guest must wait 30sec ?
 
jackassDate: Monday, 2009 August 31, 1:02 PM | Message # 4
Font size: A | A |
Major general
Group: Administrator
Message: 433
[ ]
Offline
Then use Conditional operators
Code
<?if(!$USER_LOGGED_IN$)?>Code for GUEST<?else?> Download link for users <?endif?>


 
UniqueDate: Monday, 2009 August 31, 2:06 PM | Message # 5
Font size: A | A |
Private
Group: User
Message: 19
[ ]
Offline
Tnx jackass and Brazen smile
 
SamanaleDate: Sunday, 2009 September 27, 8:54 PM | Message # 6
Font size: A | A |
Sergeant
Group: User
Message: 33
[ ]
Offline
Quote (jackass)
<?if(!$USER_LOGGED_IN$)?>Code for GUEST<?else?> Download link for users <?endif?>

it is wrong try this

Code
<?if($USER_ID$=0)?>Code for GUEST<?else?> Download link for users <?endif?>

<if($USER_ID$=0?> used because guest id is zero (0)

 
jackassDate: Sunday, 2009 September 27, 11:17 PM | Message # 7
Font size: A | A |
Major general
Group: Administrator
Message: 433
[ ]
Offline
Wops, sorry, no it's working, just this is correct

<?if(!$USER_LOGGED_IN$)?>Download link for users<?else?> Code for GUEST <?endif?>


 
SamanaleDate: Thursday, 2009 October 01, 12:27 PM | Message # 8
Font size: A | A |
Sergeant
Group: User
Message: 33
[ ]
Offline
Quote (jackass)
Wops, sorry, no it's working, just this is correct
<?if(!$USER_LOGGED_IN$)?>Download link for users<?else?> Code for GUEST <?endif?>

but it is not always working. sometimes it is auto identify guests are logged in group. try your code few attempts. if you found that use my code. lol...

Code
<?if($USER_ID$=0)?>Code for GUEST<?else?> Download link for users <?endif?>
 
UniqueDate: Thursday, 2009 October 01, 8:43 PM | Message # 9
Font size: A | A |
Private
Group: User
Message: 19
[ ]
Offline
Samanale, old code works perfect with me smile
 
njustedDate: Monday, 2010 October 25, 8:21 PM | Message # 10
Font size: A | A |
Private
Group: User
Message: 12
[ ]
Offline
I'm interested in the code, I try to put on my web, but he doesn't works...

The download doesn't shows the time countdown, and you can click in the link with out any wait....

Y put on my web the javascript code, and this code:

Code
<div>
  <?if(!$USER_LOGGED_IN$)?><a id="delayed" class="stop" href="http://www.google.com">Download (30sec)</a><?else?> Download user <?endif?>
  </div>

And nothing, doesn't work.

One time more, sorry for my english xD.
THanks!

 
BrazenDate: Thursday, 2010 October 28, 10:07 PM | Message # 11
Font size: A | A |
Colonel
Group: Administrator
Message: 304
[ ]
Offline
njusted, What type of brawser are you using?

Sadly to say, it seems like this code doesn't work in IE, but it does work in Chrome or Firefox.


LOL With Us! l Game Blog l 3D Autos

"knowledge without wisdom is curse" Alex Seb

 
njustedDate: Monday, 2010 November 01, 6:20 PM | Message # 12
Font size: A | A |
Private
Group: User
Message: 12
[ ]
Offline
I'm using Firefox.
 
uCoz Support Forum by uCozers » uCoz » General Questions » I want guests to wait 30 secs before they can download (sml[Default])
  • Page 1 of 1
  • 1
Search:


Copyrights uCozers 2009 - 2024 To TOP
Refresh Smileys Manager