Announcement

Collapse
No announcement yet.

How to add datecountdown code in forumhome?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • manutdvn
    replied
    Originally posted by Wayne Luke View Post
    Step 3 goes in Headinclude. Step 4 goes in FORUMHOME.
    Thank you. I will try

    Leave a comment:


  • Wayne Luke
    replied
    Step 3 goes in Headinclude. Step 4 goes in FORUMHOME. That code might possibly break internal vBulletin javascript though. That would make things like the WYSIWYG editor, Dropdown menus and other functions cease to work. You should ask for help in integrating this at vBulletin.org if you do not know Javascript.

    Leave a comment:


  • manutdvn
    replied
    Originally posted by Wayne Luke View Post
    You would simplay copy the code supplied into the FORUMHOME template.

    As for other versions of this. Any cut-n-paste Javascript site is bound to have one or more. You can look at www.dynamicdrive.com and see if they have any or use a search engine to find more.
    Thank yhou so much. But in the Step 3: Insert the below code between the <head>-tag and </head>-tag of your webpage. with this code:

    Code:
    <script>
    // CREDITS:
    // Dynamic Countdown Player
    // by Peter Gehrig
    // Copyright (c) 2004 Peter Gehrig and Urs Dudli. All rights reserved.
    // Permission given to use the script provided that this notice remains as is.
    // Additional scripts can be found at [URL="http://www.24fun.com"]http://www.24fun.com[/URL]
    // [EMAIL="[email protected]"][email protected][/EMAIL]
    // 2/28/2004
    // IMPORTANT:
    // If you add this script to a script-library or a script-archive
    // you have to insert a link to [URL="http://www.24fun.com"]http://www.24fun.com[/URL] 
    // right into the webpage where the script will be displayed.
    var futureyear=2004
    var futuremonth=11
    var futureday=24
    var displaytype="showall"
    var aftercountdown="stopit"
    var digitordate="isdate"
    var digitfrom=100
    var digitto=1
    var speed=1
    var countdownid=new Array()
    var futuredate
    var nowdate
    var resulthoursraw
    var resulthours
    var resultminutesraw
    var resultminutes
    var resultsecondsraw
    var resultseconds
    var p_seconds
    var p_minutes
    var p_hours
    var p_days
    var resultsecondsonly
    var resultminutesonly
    var resulthoursonly
    var content
    var i_countdown=-1
    var countdownid
    var step=1
    speed*=1000
    if (digitfrom>digitto) {step=-1}
    if (digitfrom<digitto) {step=1}
    var browserinfos=navigator.userAgent 
    var ns4=document.layers
    var ie4=!document.getElementById&&document.all&&!browserinfos.match(/Opera/)
    var ie5=document.getElementById&&document.all&&!browserinfos.match(/Opera/)
    var ns6=document.getElementById&&!document.all&&!browserinfos.match(/Opera/)
    var opera=browserinfos.match(/Opera/)  
    function setfuturedate() {
     futuredate=new Date(futureyear,futuremonth,futureday,0,0,0)
     if (digitordate=="isdigit") {content=digitfrom-step }
     docountdown()
    }
    function docountdown() {
     if (digitordate=="isdate") {
      calculateresults()
      formatresults()
      displayresults()
      setTimeout("docountdown()",speed)
     }
     else if (digitordate=="isdigit") {
      content+=step 
      displayresults()
      if (content==digitto) {
       setTimeout("happensafter()",speed)
      }
      else {
       setTimeout("docountdown()",speed)
      }
     }
    }
    function firstcountdown() {
     if (digitordate=="isdate") {
      futuredate=new Date(futureyear,futuremonth,futureday,0,0,0)
      calculateresults()
      formatresults()
     }
     else if (digitordate=="isdigit") {
      content=digitfrom
     }
    }
    function calculateresults() {
    nowdate=new Date()
    resultdaysraw=(Date.parse(futuredate)-Date.parse(nowdate))/1000/60/60/24
    if (displaytype!="showall") {
     resultsecondsonly=Math.floor((Date.parse(futuredate)-Date.parse(nowdate))/1000)
     resultminutesonly=Math.floor((Date.parse(futuredate)-Date.parse(nowdate))/1000/60)
     resulthoursonly=Math.floor((Date.parse(futuredate)-Date.parse(nowdate))/1000/60/60)
    }
    else {
     resultdays=Math.floor((Date.parse(futuredate)-Date.parse(nowdate))/1000/60/60/24)
     resulthoursraw=(resultdaysraw-resultdays)*24
     resulthours=Math.floor((resultdaysraw-resultdays)*24)
     resultminutesraw=(resulthoursraw-resulthours)*60
     resultminutes=Math.floor((resulthoursraw-resulthours)*60)
     resultsecondsraw=(resultminutesraw-resultminutes)*60
     resultseconds=Math.floor((resultminutesraw-resultminutes)*60)
     }
    }
    function formatresults() {
     if (displaytype=="showall") {
      if (resultdays>1) {p_days="days"}
      else {p_days="day"}
      if (resultminutes<10) {resultminutes="0"+resultminutes}
      if (resultseconds<10) {resultseconds="0"+resultseconds}
      content=resultdays+" "+p_days+" "+resulthours+"h "+resultminutes+"m "+resultseconds +"s"
     }
     else if (displaytype=="showdays") {
      if (resultdays>1) {p_days="days"}
      else {p_days="day"}
      content=resultdays+" "+p_days
     }
     else if (displaytype=="showhours") {
      content=resulthoursonly+" hrs"
     }
     else if (displaytype=="showminutes") {
      content=resultminutesonly+" min"
     }
     else if (displaytype=="showseconds") {
      content=resultsecondsonly+" sec"
     }
    }
    function happensafter() {
     if (aftercountdown=="repeatit") {
      if (digitordate=="isdigit") {content=digitfrom-step}
      docountdown()
     }
     if (aftercountdown!="stopit" && aftercountdown!="repeatit") {
      document.location.href=aftercountdown
     }
    }
    function displayresults() {
     if (ie4) {
      for (i=0;i<=countdownid.length-1;i++) {
       var thisclock=eval(countdownid[i])
       thisclock.innerHTML=content
      }
     }
     else {
      for (i=0;i<=countdownid.length-1;i++) {
       document.getElementById(countdownid[i]).innerHTML=content
      }
     }
    }
    function setcountdown() {
     if (ns4 || ie4 || ie5 || ns6 || opera) {
      firstcountdown()
      i_countdown++
      countdownid[i_countdown]="countdown"+i_countdown
      document.write("<span id='"+countdownid[i_countdown]+"' style='position:relative'>"+content+"</span>")
     }
    }
    if (ie4 || ie5 || ns6 || opera) {
     onload=setfuturedate
    }
    </script>
    where can I put this?

    and the Step 4: Insert the below code where you want the countdown player to appear on your page with this code:

    Code:
    <script>setcountdown()</script>
    --->where can I put this?

    And finally, Step 5: In order to set the style (font, colors, size) just wrap the corresponding tags around the code. See CSS-sample below:
    Code:
    [SIZE=1][FONT=Arial][COLOR=#0000ff]<span style="font-family:Verdana;font-size:12pt;color:#006600;border:1pt solid #006600;padding:2px;background-color:#DDFFDD"">
    [/COLOR][COLOR=gray]<script>setcountdown()</script>[/COLOR][/FONT][/SIZE]
    [FONT=Arial][SIZE=1][COLOR=#0000ff]</span>[/COLOR][/SIZE][/FONT]
    How can I change the color in forumhome?

    Sorry for the stupid question, but I donot know how to do. Please help!

    Leave a comment:


  • Wayne Luke
    replied
    You would simplay copy the code supplied into the FORUMHOME template.

    As for other versions of this. Any cut-n-paste Javascript site is bound to have one or more. You can look at www.dynamicdrive.com and see if they have any or use a search engine to find more.

    Leave a comment:


  • manutdvn
    started a topic How to add datecountdown code in forumhome?

    How to add datecountdown code in forumhome?

    Hello,

    I donot know how to add datecountdown code in forumhome that I got from this web:

    http://www.24fun.com/downloadcenter/...countdown.html

    One more question, anybody know other datecountdown web? It looks better than this?

    Thanks in advance.
Loading...
Working...
X