Plugin

Archived
Forum
(read-only)

MB Countdown

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Mark Bowen Design

     

time parameter also needed!

Feature Request

romanovsky2007
romanovsky2007

hi Mark!

That would be great idea to add to the plugin a “time” parameter, i mean not all events start at midnight..
Do you think that’s possible to make it?

With respect,
Dmitry Romanovsky

Mark Bowen Design
# 1
Developer
Mark Bowen Design

Hi Dmity,

I’ll take a look at this as you should just be able to specify the time in the date parameter as it is using human readable time formats so something like :

date="9th June 2011 12:34" 

should work although I did just test it and seems I can only get it to work with PM times for some reason. Will have to check out why that’s happening.

Best wishes,

Mark

Mark Bowen Design
# 2
Developer
Mark Bowen Design

Hi Dmitry,

Seems I hadn’t added in the full now() date in the plugin so whilst you could indeed supply the time in the parameter it wouldn’t have made full sense to the calculations inside the plugin. Hopefully now you should be able to specify the full time using any of the supported date / time formats for the strtotime() PHP function.

romanovsky2007
# 3
romanovsky2007

i can’t believe you reacted so fast!
Yes it works great now, thank you!

Dmitry

Mark Bowen Design
# 4
Developer
Mark Bowen Design
Dmitry - 07 June 2011 01:05 PM

i can’t believe you reacted so fast!
Yes it works great now, thank you!

Dmitry


No problem at all.

Let me know if you have any problems with it in the future though. It’s supposed to work with any of the supported date / time functions of the strtotime function although I do believe some of the weirder ones might not be working.

That said I don’t think many people would ever use those anyway so hopefully this should never be an issue.

Best wishes,

Mark

24here
# 5
24here

I have this on all my entries: “43 years, 1 month, 10 days, 15 hours, and 24 minutes left until My Birthday”

I use this time format
{entry_date format=’%j%S %F %Y %g:%i %a’}

It looks like
{exp:mb_countdown
date=”{entry_date format=’%j%S %F %Y %g:%i %a’}”
event=“My Birthday”}
{if years > 0}{years} year{if years > 1}s{/if}, {/if}{if months > 0}{months} month{if months > 1}s{/if}, {/if}{if days > 0}{days} day{if days > 1}s{/if}, {/if}{if hours > 0}{hours} hour{if hours > 1}s{/if}, {/if}{if hours <= 0}{minutes} minutes{/if}{if hours > 0}{if minutes > 0}and {minutes} minute{if minutes > 1}s{/if}{/if}{/if} left until {event}
{/exp:mb_countdown}

Mark Bowen Design
# 6
Developer
Mark Bowen Design

Hi 24here,

Sorry but I’m not too sure what your question is here?

Are you saying that every single entry is coming out with the exact same output?

If so then I noticed above that you are using the {entry_date} tag which I must say I haven’t tested in this plugin. It was really meant for a static (hand written) date to be supplied.

I’ll take a look and try it this end if that is the case though and see if it can be made to do that though.

Please let me know if that is indeed the problem here.

Best wishes,

Mark

Mark Bowen Design
# 7
Developer
Mark Bowen Design

Also one other question would be, do you have the code above placed inside a Channel Entries tag? If not then this isn’t going to work as you are supplying an {entry_date} tag which will only come from being placed inside a Channel Entries tag.

I just checked though and it should all work. I tested using this code below :

{exp:channel:entries channel="default_site" show_future_entries="yes"}
{title}
<br />

{exp:mb_countdown date="{entry_date format='%j%S %F %Y %g:%i %a'}" event="My Birthday"}
{if years 
0}{years} year{if years 1}s{/if}{/if}{if months 0}{months} month{if months 1}s{/if}{/if}{if days 0}{days} day{if days 1}s{/if}{/if}{if hours 0}{hours} hour{if hours 1}s{/if}{/if}{if hours <= 0}{minutes} minutes{/if}{if hours 0}{if minutes 0}and {minutes} minute{if minutes 1}s{/if}{/if}{/if} left until {event}
<hr />
{/exp:mb_countdown}

{
/exp:channel:entries} 

You would obviously need to change the channel=“default_site” parameter to reflect your Channel name first though and make sure that you use the show_future_entries=“yes” parameter in order for future entries to work however that should work for you.

Please let me know if it doesn’t though.

Best wishes,

Mark