|
uCoz Community Archives Locked How to make guests to wait 30 secs before they can download (Tutorial) |
How to make guests to wait 30 secs before they can download |
1. 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> 2. Add this code where you want your download link to appear: Code <div> <a id="delayed" class="stop" href="http://www.uCoz.com/">Download (30sec)</a> </div> C/P ExtraCafe.rs, we're the best !
|
NTP, it's works fine for me, you need to make it visible only for guest with conditional operations:
Code <?if(!$USER_LOGGED_IN$)?>Download link for users<?else?> Code for GUEST <?endif?> or
Code <?if($USER_ID$=0)?>Code for GUEST<?else?> Download link for users <?endif?> ExtraCafe.rs, we're the best !
Post edited by Unique - Friday, 2010-10-08, 1:17 PM
|
| |||
| |||