in phpBB you'd need to run the MySQL query to disable your forums:
Code:
UPDATE `phpbb_config` SET `config_value` = '1' WHERE `config_name` = 'board_disable'
you'd need to then run another query to turn the forms back on:
Code:
UPDATE `phpbb_config` SET `config_value` = '0' WHERE `config_name` = 'board_disable'
A little script i just threw together that i *think* would work...
Make a file called formonoff.php Place this file in your main forums directory (That's the one with the files like index.php, posting.php, etc..)
Even though the script does use some simple security to prevent people from using their web browser to use the script, you might want to edit your .htaccess file, or set the permissions in such a way that your web server can't execute it. Place the following code in the file:
PHP Code:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$action = $argv['1'];
$key = $argv['2'];
if ($key != 'e7YMe8')
{
die('Not allowed to run script!');
}
if($action == 'off')
{
$sql = "UPDATE `phpbb_config` SET `config_value` = '1' WHERE `config_name` = 'board_disable'";
} else if ($action == 'on')
{
$sql = "UPDATE `phpbb_config` SET `config_value` = '0' WHERE `config_name` = 'board_disable'";
} else {
die('No action given!');
}
if (!($db->sql_query($sql)))
{
die('SQL Error!');
}
?>
You'll then need to make a cron tab to run the following command to turn off your forums:
Code:
php -f /PATH_TO_FORUMS_HOME/formonoff.php off e7YMe8
... and then this one to turn them back on:
Code:
php -f /PATH_TO_FORUMS_HOME/formonoff.php on e7YMe8
fyi.. you can change the key if you'd like.. just be sure to change it both in the cron tab thingie and in the script
hope this helps ya
(ps: I'm not really sure why you'd want them to turn off/on at times of the day.. but.. heh. whatever works for ya

)
Jack