MTCountdown v0.4

I have finally gotten around to cleaning up the quickie update I did to help out the Blog for America folks.

So, here is a summary of the changes in this version:

  • Bugfixes:
    • Changed time difference checking to look for difference >= 0 instead of just difference > 0. This may have caused some odd behavior when time differences fell on exact boundaries.
  • New Attributes:
    • MTCountdown / MTCountup : count_only
      • A list of the specific time periods to check, seperated by a commas (e.g. "years,days,hours")
      • Only periods from the following list will be considered:
        • years
        • weeks
        • days
        • hours
        • minutes
        • seconds
      • Important: The time periods will be counted in the order they are given. If you put 'days' before 'years', the 'days' counter will gobble up all the time before checks for 'years' are performed.

Download it here:

Note: I know I have been asked this before, so I would like to head off the feature requests right now. I currently have no plans to incorporate 'months' into the list of periods checked, as months do not have a fixed length. If somebody else wants to put together the code to do that calculation, I would be happy to integrate it into the plugin, but I do not plan on doing it myself.

2 TrackBacks

Countdown from MT Plugin Directory on March 1, 2004 1:13 AM

0.2 adds CountUp tags. 0.4 adds a way to specify only certain counts to calculate.... Read More

I installed David Raynes' MTCountdown to enhance our site statistics. Check out the results on our main page, the site stats on the left nav bar.... Read More

12 Comments

I'm unable to get this to work properly. Here's the code I've entered:


days,
hours,
minutes,
seconds
until I leave for Europe.

It's only outputting the hours and minutes but not the days or seconds. Can you see what I'm doing wrong?

Isn't Dean out of the running?

Isn't Dean out of the running?

This code:
<MTCountdown until="2004-12-25 00:00:00">
<MTCountdownIfDays><MTCountdownDays> days, </MTCountdownIfDays>
<MTCountdownIfHours><MTCountdownHours> hours </MTCountdownIfHours>
</MTCountdown>

Returns the following error:
Build error in template 'Left Column': Error in tag: '' does not match

MT::App::CMS=HASH(0x834a05c) Use of uninitialized value in substitution (s///) at plugins/countdown.pl line 87.
MT::App::CMS=HASH(0x834a05c) Use of uninitialized value in pattern match (m//) at plugins/countdown.pl line 94.
MT::App::CMS=HASH(0x834a05c) Use of uninitialized value in concatenation (.) or string at plugins/countdown.pl line 98.

Hey good job at Blog for America. The candidate didn't make it but the blog was a hit.

I get the following error message :(

Build error in template 'Main Index': Error in tag: '' does not match

Please help!

Does this plug-in still require the Storable.pm? Installed the plug-in (easy... ) then "Can't locate Storable.pm in @INC" up on the screen...

Does this work in MT 3.0?

I'm getting the same error as Doc. Any advice?

I'm having the same problem as Doc and Jenna. Anyone have any suggestions?

I had problems with the published template code, then tried using date= instead of until=

The code was published, but the count wrong.

It gave me 6 days until january!

Using MT3.2


By the way the sign-in for typekey seems suspect, I got an error.

The problem is a missing set of parentheses in some code around line 81. Change it to:

my $until = ($args->{'date'} or $args->{'until'}) or
return $ctx->error ("MTCount$tag requires a 'date' or 'until' argument");

Leave a comment

Recent Entries

  • Plugin Writing 101

    So, I’m planning on writing up some entries about various aspects of plugin development. While I have a couple topics already in mind, I thought...

  • The Olympics Make Me Want To Compete Again

    Every time the Olympics come around (most the summer ones) I always start to delude myself into thinking I could complete once again in the...

  • Minimalist plugins are fun!

    Last night I whipped up one of the smallest plugins I’ve ever written. It is so small in fact that I was able to stuff...

  • Feedburner Widget on MT News

    Movable Type News A WordPress 2.5 Upgrade Guide: And of course there are lots of third-party plugins for the MT dashboard, to integrate statistics and...

  • AD&D Monster Stats for the Presidential Canditates

    Charles Stross (scifi author, D&D nerd, and former perl columnist) posted Politics as she is Played with 3d6: The recent death of Gary Gygax, who...

Close