Lack of interest [Suggestion] - Databaseless On/Off Switch

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Jafo

Active member
It would be nice if there was an option to use a file method to store the forums "on/off" status. When you turn a VB forum off, the script still has to access the db to see if the forum is off which can cause some issues during database repairs and dumps.

I already wrote an in-house product to do it for my VB forums but it sure would be nice if it was stock.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Given that admins can still access when it's off, I don't think this would really work. If you need to take it down because of DB issues, you're likely better off breaking execution in the config script.
 
A simple .htaccess with rewind to a landingpage and exclude my/our fix IP's is the easy way. :)
 
A wordpress style file based maintenance would be cool though... if you simply create a .maintenance in the domain root with the error message... This would disable for all even admin's and can be editied to allow for custom HTML page etc... After this no DB calls etc are made, this would be a great and easy way to take the site down with a nice error message while you do DB changes without having to break the config.php script..
 
Given that admins can still access when it's off, I don't think this would really work. If you need to take it down because of DB issues, you're likely better off breaking execution in the config script.

Actually I have it setup in VB where I can exclude IP addresses. Also, it does break execution in the config file:

$GLOBALS['preinit'] = '/path/to/writeable/maint.txt';

if (defined('CWD'))
{
include_once(CWD . '/includes/pre-init.php');
}

From there it checks the maint.txt file which has a serialized array of the maintenance status, exclusions and the message to show to users.

(pre-init):

if (file_exists($GLOBALS['preinit']) and THIS_SCRIPT != 'maintenance_mode' and THIS_SCRIPT != 'login')
{
$arr = file_get_contents($GLOBALS['preinit']);
$arr = unserialize($arr);
if (!in_array($_SERVER['REMOTE_ADDR'], $arr['ips']))
{
## include a file that shows the maint message and then exits..
}
}
 
Top Bottom