Multimedia (depraced!) > New Year Script
New Year ScriptDate: 18 December 2009 | Posted by: Protocol |
![]() Let your site users to know how much is left before new year! Installation instruction on DLE 6.0-8.3: First download this picture rename it on TREE.GIF and upload it on your ftp server in templates/Default or Simple/images/: http://s56.radikal.ru/i152/0912/8f/275da192c327.gif Then post this code into templates/Default or Simple/main.tpl FIRST CHANGE THE DIRECT WAY TO YOUR TEMPLATE IN THIS CODE: <script language=\'javascript\' type=\'text/javascript\'>
function fulltime () { var time=new Date(); var newYear=new Date(\"jan,01,2010,00:00:00\"); var totalRemains=(newYear.getTime()-time.getTime()); if (totalRemains>1){ var RemainsSec = (parseInt(totalRemains/1000)); var RemainsFullDays=(parseInt(RemainsSec/(24*60*60))); var secInLastDay=RemainsSec-RemainsFullDays*24*3600; var RemainsFullHours=(parseInt(secInLastDay/3600)); if (RemainsFullHours<10){RemainsFullHours=\"0\"+RemainsFullHours}; var secInLastHour=secInLastDay-RemainsFullHours*3600; var RemainsMinutes=(parseInt(secInLastHour/60)); if (RemainsMinutes<10){RemainsMinutes=\"0\"+RemainsMinutes}; var lastSec=secInLastHour-RemainsMinutes*60; if (lastSec<10){lastSec=\"0\"+lastSec}; document.getElementById(\"RemainsFullDays\").innerHTML=RemainsFullDays+\"<span id=\'Rem\'> Days</span>\"; document.getElementById(\"RemainsFullHours\").innerHTML=RemainsFullHours+\"<span id=\'Rem\'> hour</span>\"; document.getElementById(\"RemainsMinutes\").innerHTML=RemainsMinutes+\"<span id=\'Rem\'> minute</span>\"; document.getElementById(\"lastSec\").innerHTML=lastSec+\"<span id=\'Rem\'> seconds</span>\"; <!-- highslide start --> setTimeout(\'fulltime()\',10) } else{ document.getElementById(\"clock\").innerHTML=\"Happy New <br>Year !!!\"; } } </script> <style type=\'text/css\'> #clou_xs {position:relative;width:200px;height:245px;background: url(/templates/DEFAULT OR SIMPLE/images/tree.gif[/color] no-repeat} #clock {width:175px;height:235px;text-align:right;color:#708090;font-size:13px;} #RemainsFullDays {font-size:25px;color: #ff0000;} #RemainsFullHours {position:absolute;bottom:1px;left:40px;font-size:15px;color:#708090;} #RemainsMinutes {position:absolute;bottom:1px;left:87px;font-size:15px;color:#708090;} #lastSec {position:absolute;bottom:1px;left:135px;font-size:15px;color:#708090;} #Rem {font-size:11px;font-weight:normal;color:#708090;} </style> <div id=\'clou_xs\'> <div id=\'clock\'>Before new year is left<br><br> <span id=\'RemainsFullDays\'></span> <span id=\'RemainsFullHours\'></span> <span id=\'RemainsMinutes\'></span> <span id=\'lastSec\'></span> </div> </div> <script language=\'javascript\'>fulltime();</script> See full article |