I want guests to wait 30 secs before they can download
|
|
Unique | Date: Sunday, 2009 August 30, 9:26 PM | Message # 1
|
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 ?
|
|
| |
Brazen | Date: Sunday, 2009 August 30, 11:42 PM | Message # 2
|
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
|
|
| |
Unique | Date: Monday, 2009 August 31, 12:35 PM | Message # 3
|
Private
Group: User
Message: 19
[ ]
Offline
| It`s work but i want only guest must wait 30sec ?
|
|
| |
jackass | Date: Monday, 2009 August 31, 1:02 PM | Message # 4
|
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?>
|
|
| |
Unique | Date: Monday, 2009 August 31, 2:06 PM | Message # 5
|
Private
Group: User
Message: 19
[ ]
Offline
| Tnx jackass and Brazen
|
|
| |
Samanale | Date: Sunday, 2009 September 27, 8:54 PM | Message # 6
|
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)
|
|
| |
jackass | Date: Sunday, 2009 September 27, 11:17 PM | Message # 7
|
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?>
|
|
| |
Samanale | Date: Thursday, 2009 October 01, 12:27 PM | Message # 8
|
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?>
|
|
| |
Unique | Date: Thursday, 2009 October 01, 8:43 PM | Message # 9
|
Private
Group: User
Message: 19
[ ]
Offline
| Samanale, old code works perfect with me
|
|
| |
njusted | Date: Monday, 2010 October 25, 8:21 PM | Message # 10
|
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!
|
|
| |
Brazen | Date: Thursday, 2010 October 28, 10:07 PM | Message # 11
|
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
|
|
| |
njusted | Date: Monday, 2010 November 01, 6:20 PM | Message # 12
|
Private
Group: User
Message: 12
[ ]
Offline
| I'm using Firefox.
|
|
| |