Do you guys know how to make phpBB or vBulletin turn inactive or closed during specific times of the day… I’m sure there is a hack to do it… or if someone could write one… that would be awesome… Our school system does not allow us to view forums during specific times of the day during the school year. We would like to use a forum system to post messages rather than mass-email everyone…
Not that I am familiar with… But wouldn’t the easiest way to follow the school policies be to just not look at it during those times??
For example, our team forum is just for messages.
I’m not sure as to what you mean “mass e-mail” people through team forums.
The basic use of a forum system is to act as a bulletin board, or post messages and reply to these messages.
I know that “mass e-mailing” is possible through certain forum systems, like this one for example, but if you just want post messages and also adhere to school policies, just do not visit the forums. Simple.
If you use phpBB or vBulletin, they have the ability to be shut off. You can write a script that runs whenever you need to turn the site on & off. I use one for the backups. You’ll notice, if you are on chiefdelphi at 5:47am EST, the forums are off. That is all automagic.
in phpBB you’d need to run the MySQL query to disable your forums:
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:
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
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:
php -f /PATH_TO_FORUMS_HOME/formonoff.php off e7YMe8
… and then this one to turn them back on:
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 :))
Well yes… but they are ways around it… but i’m not sure if we will actually use a forum system… it was just brought up and I was thinking of a way to do it without getting in trouble… but thanks guys… that’s some good scripts…
…does the fact that it’s done at 5:47 have any significance, or am I just becoming one of my english teachers where everything is a symbol, regardless of the insignificance the author meant?