1
daddystu
Turning a module 'on' at a certain regular time?
  • 2005/9/24 10:31

  • daddystu

  • Just popping in

  • Posts: 100

  • Since: 2004/5/25


Let's say you have a group, Registered Users.
Let's say you want them to have access to a certain module BUT only between the hours of 6 and 10 at night, and weekends.

Can this be scheduled automatically?
Any ideas?

Specifically, chat sessions are available only at certain, shcheduled times.

TIA for any ideas.
??????- isogebamaware

2
Dave_L
Re: Turning a module 'on' at a certain regular time?
  • 2005/9/24 11:32

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


$now getdate();
if (
$now['wday'] >= and $now['wday'] <= and ($now['hours'] < 18 or $now['hours'] >= 22)) {
   
redirect_header(XOOPS_URL5"The chat module is only available on weekends, and between 6PM and 10PM on weekdays.");
}


Reference: PHP function getdate

You just have to insert that code in the appropriate place(s). If it's in more than one place, I suggest putting the code in a function.

The text string in the redirect_header() call should be replaced with a language constant.

3
davidl2
Re: Turning a module on at a certain regular time?
  • 2005/9/24 11:41

  • davidl2

  • XOOPS is my life!

  • Posts: 4843

  • Since: 2003/5/26


Very nice idea!

4
daddystu
Re: Turning a module 'on' at a certain regular time?
  • 2005/9/25 9:55

  • daddystu

  • Just popping in

  • Posts: 100

  • Since: 2004/5/25


Excellent!
OK, I will give it a go and let you know.
Thanks so much....
??????- isogebamaware

Login

Who's Online

145 user(s) are online (97 user(s) are browsing Support Forums)


Members: 0


Guests: 145


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits