Results 1 to 1 of 1
  1. #1

    • Know More Than You Should
    • Offline

    Join Date
    Feb 2005
    Location
    Experiencing Technical Difficulties
    Posts
    2,906

    Lightbulb MiceChat Countdown Feature

    There's been some talk about a countdown feature, which will be coming "soon", and so I had a suggestion, for the script that is:

    HTML Code:
    <script>
    
    
    //change the text below to reflect your own,
    var current=0
    var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
    
    function countdown(yr,m,d){
    var today=new Date()
    var todayy=today.getYear()
    if (todayy < 1000)
    todayy+=1900
    var todaym=today.getMonth()
    var todayd=today.getDate()
    var todaystring=montharray[todaym]+" "+todayd+", "+todayy
    var futurestring=montharray[m-1]+" "+d+", "+yr
    var difference=(Math.round((Date.parse(futurestring)-Date.parse(todaystring))/(24*60*60*1000))*1)
    if (difference==0)
    document.write(current)
    else if (difference>0)
    document.write(+difference)
    }
    //enter the count down date using the format year/month/day
    countdown(2005,5,5)
    </script>
    This script would display the number of days only. The idea is that when you have the start tag (say, [countdown]) that would be everything up until "countdown(" you would then enter your date, (eg. 2005,5,5) and then the closing tag ([/countdown] would be the ")" and the </script>

    Set as mentioned above, the script would produce the following result:

    29

    therefore, you would simply write:

    It's only [countdown]2005,5,5[/countdown] days until May 5!

    which would display as:

    It's only 29 days until May 5!


    and it would update itself every day. On the day in question, the script would display "0".

    This script, by the way, is a modified version of a script from the Javascript Kit.

    I'm not sure if it would work, I'm pretty sure it will, I read the FAQ on the vBulletin site to try to get a better undertstanding of how the vB scripts work, and I think this should work. I guess the admins can play around with it. Or maybe they've already been working on something. Anyway, hope this helps.
    Last edited by Club 33; 04-06-2005 at 09:13 AM.













Similar Threads

  1. Replies: 36
    Last Post: 10-24-2008, 04:39 PM
  2. MiceChat Feature Speculation/Discussion: Upgrade
    By Monorail Man in forum The Forums
    Replies: 331
    Last Post: 07-03-2008, 12:02 PM
  3. Top 20 Countdown!
    By VMKPrincess1 in forum Disney Interactive and Game Industry Discussion
    Replies: 6
    Last Post: 11-06-2006, 02:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •