Log in

View Full Version : Forum closing times


silvermerc
01-10-2009, 10:29 PM
Is there a mod where the forum closes at a certain time then re-opens again at another time?
Ross

Bellardia
01-10-2009, 10:38 PM
I don't believe so, but the idea is pretty simple im premise.

A very simple way would be using a global hook that checks the time, if it's a certain time it sends out standard_error which would halt the board and include a phrase that says something like "The board is closed for posting from 10pm-6am, please come back later".

silvermerc
01-10-2009, 11:42 PM
Could you make it?

Bellardia
01-11-2009, 12:52 AM
What time do you want your board to close/open?

I can't guarantee this is the most efficient method either, but I believe it should work.

silvermerc
01-11-2009, 01:09 AM
Close at 1am open at 6

Vackrick
01-11-2009, 01:46 AM
Bllardia could u make this for 3.7.3

And we can set the time when they board will close pls thx^^

Bellardia
01-11-2009, 02:12 AM
I'd create a quick plugin for you, if you want to edit the times you'll have to edit the php source directly.

Vackrick
01-12-2009, 05:11 AM
are u releasing it????

Bellardia
01-12-2009, 11:37 AM
I got a little sidetracked on this :x
I'll PM it to you tonight

Hex_legend
01-12-2009, 11:05 PM
Could you post it?
I would be interested in having this too

Bellardia
01-13-2009, 12:30 AM
Simple script starter script, optimize and recode to make it better, hopefully this will get you all on the right track! I left out phrases and such for ease of posting, like I said feel free to add them as well as optimize the time functions etc.

The hook I used was global_startup_complete

$time_open_hour = '06'; // Time time the board opens in HOURS - 24 HOUR CLOCK - VBULLETIN TIME - LEADING 0
$time_open_minutes = '00'; // Minutes from the hour that the board opens - LEADING 0
$time_close_hour = '16'; // Time the board closes in HOURS - 24 HOUR CLOCK - VBULLETIN TIME - LEADING 0
$time_close_minutes = '23'; // Minutes from the hour that the board closes - LEADING 0

// ################# LEAVE THIS ################
$time_now = date('Gi', TIMENOW);
if ( !(($time_now >= $time_open_hour.$time_open_minutes) AND ($time_now <= $time_close_hour.$time_close_minutes)) )
{
eval(standard_error("The forum is closed, please return after HOURS:MINUTES"));
}


If you have something to contribute, edit it and repost :) Together we could make a good product.

Vackrick
01-13-2009, 04:50 AM
how to use tat???

can u release it full???