Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-24 13:50:51

beechy
Member
Registered: 2006-03-02
Posts: 92

Show code depending on what time it is

Is there a textpattern tag that would allow me to show html code between certain hours?

i.e I want a button on my site to say “open” between the hours of 6.30am and 12 midnight and “closed” at any other time.

Last edited by beechy (2008-11-24 13:51:13)

Offline

#2 2008-11-24 19:34:19

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Show code depending on what time it is

Do you want access to the entire site restricted, certain areas, or just display changes?

Last edited by rsilletti (2008-11-24 21:02:38)

Offline

#3 2008-11-25 09:50:27

beechy
Member
Registered: 2006-03-02
Posts: 92

Re: Show code depending on what time it is

Hi rsilletti,

Basically I have a booking system that I only want to be available from 6.30am to 12 midnight so only want to display a link to it on the site at these times. All other times I want the link to be hidden.

I suspect that this would be best as a piece of raw php code.

Offline

#4 2008-11-25 17:13:08

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Show code depending on what time it is

Yes, I think that would take a plugin built specifically to do that, anything that I know or have written work as offsets from present or a preset time.

Offline

#5 2008-11-25 20:31:23

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Show code depending on what time it is

Ouch! Give me a while – i’m writing such plugin!


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2008-11-25 22:59:06

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: Show code depending on what time it is

Let me know if you need some help with testing and such.

Offline

#7 2008-11-26 00:10:03

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Show code depending on what time it is

Plugin is ready for use!

P.S. Rick, thanks for you offer. If you wish, you can test pugin now. Feel free to post any thoughts to its forum thread


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#8 2008-11-26 16:09:47

beechy
Member
Registered: 2006-03-02
Posts: 92

Re: Show code depending on what time it is

Cool what a result will try it out and get back to you on how I get on.

Offline

Board footer

Powered by FluxBB