Gossamer Forum
Home : Products : DBMan : Customization :

Database maintenance message

Quote Reply
Database maintenance message
I suppose most of you come up with the idea to add another field and another field to your DB as time goes by.

When expanding the database there are two methods to do it without any complications:

1- To create empty (unused) fields from the beginning.
2- To rename the database-file temporarily, so the users won't change/add anything in the meantime.

The second solution produces an internal error message, and that's where my question comes in:

Can somebody come up with a bit of code (primarily to put in db.cgi with a check on the filename in the CFG) that would make it able to display a properly formatted message that lets the user know "The database is under maintenance" ALREADY BEFORE logging in?

GREAT! Thanks! ;-)

/CSky


Quote Reply
Re: Database maintenance message In reply to
1) Add a variable in the default.cfg file:

Code:

$db_shutdown = 1;


2) Then at the top of the db.cgi before sub main, add the following conditional statement:

Code:

if ($db_shutdown) {
&html_shutdown;
}


3) Then in the html.pl, add a subroutine called sub html_shutdown. This should be a copy of sub html_home, but add your "closed" message.

Good luck!

Regards,

Eliot Lee
Quote Reply
Re: Database maintenance message In reply to
That was very basic (good to learn)

Thank you, Eliot!

CSky


Quote Reply
Re: [Heckler] Database maintenance message In reply to
Hi Eliot

I tried your solution but I seem to be getting both the "home page" and the "maintenance mode page". Any suggestions ?

Thanks in advance.

FHN
Quote Reply
Re: [fhnaqvi] Database maintenance message In reply to
When you made the new sub, did you rename the top of it:

sub html_shutdown

& then put your own message in?
Diana Rae
Quote Reply
Re: [dianarae] Database maintenance message In reply to
Yes I did exactly as mentioned in the post above by Eliot Lee.

FHN
Quote Reply
Re: [fhnaqvi] Database maintenance message In reply to
Well, now, six and a half years later:

Eliot's suggestion doesn't work because the if statement should be placed elsewhere. So his suggestion should not read:

Then at the top of the db.cgi before sub main, add the following conditional statement:

but instead:

Then in db.cgi in sub main just before all the if statements, add the following conditional statement:


Then it will work!

Regards
CSky
Quote Reply
Re: [seasky] Database maintenance message In reply to
Even better would be to put it in db.pl right after:

require "auth.pl"; # Authorization Routines
};


Greetings
CSky

Last edited by:

seasky: Oct 10, 2008, 12:22 PM
Post deleted by seasky In reply to