Oops - Database Down

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27361
Joined: Sat Aug 16, 2003 7:36 am

Oops - Database Down

Post by Extensions Robot » Mon Jul 02, 2007 5:49 pm

Modification name: Oops - Database Down
Author: eviL<3
Modification description: When your database is down: Instead of the familiar "Critical error, could not connect message", your users will get redirected to a custom error page. There they will have an option to send you an email, i.e. to notify you that something is wrong. It is easy to style the error page to suit your taste just mess about with the html code until your happy with the outcome.
Modification version: 1.0.0
Tested on phpBB version: 2.0.22

Download file: oops_1_0_0.zip
File size: 22927 Bytes

Modification overview page: View


Selected tags:
  1. category
    1. Add-Ons
  2. phpbb
    1. 2.0.22
Support for this modification needs to be asked within this topic. The phpBB Team is not responsible or required to give anyone support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version listed in the topic. It may not work in any other versions of phpBB.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 23721
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Oops - Database Down

Post by Paul » Mon Jul 02, 2007 5:49 pm

Modification validated/released

Notes:
The "could not connect to the database" error looks like with this mod a bit how it looks in phpBB3.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Oops - Database Down

Post by igorw » Mon Jul 02, 2007 6:01 pm

Finally! Thanks! Reserving this post :twisted:

Demo:
Image

Notes:
Original MOD by Joe Belmaati, later overtaken by eviL3
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

phatchopolis
Registered User
Posts: 166
Joined: Mon May 29, 2006 11:40 pm

Re: Oops - Database Down

Post by phatchopolis » Sat Jul 07, 2007 7:22 am

I like the idea. Would this just show if say the database isn't reachable because of server being busy? This doesn't effect the error code that we get shown if there's an error in the template or php codes for the forum like say when modding goes wild. :mrgreen:

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Oops - Database Down

Post by igorw » Sat Jul 07, 2007 8:18 am

Hi,

Well yes, if the mysql server is having problems (or the password is wrong :roll:), you will get a nice error instead an awful one. But if you do something wrong with modding, you'll still get the good ol' php error... :lol:
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Apolloneos
Registered User
Posts: 46
Joined: Sat Nov 25, 2006 6:58 pm
Location: Hellas
Contact:

Re: Oops - Database Down

Post by Apolloneos » Tue Sep 18, 2007 5:08 pm

How can the email be sent to 2 administrators?
Also, when the database is down, the oops_mail_sent.txt takes the value 1. Must we change it to 0 when the database is ok, or not?

th3l33t1
Registered User
Posts: 87
Joined: Wed Jan 31, 2007 12:10 pm

Re: Oops - Database Down

Post by th3l33t1 » Tue Sep 18, 2007 8:12 pm

nice idea for a mod! thanks ;)

James N
Registered User
Posts: 1737
Joined: Sat May 20, 2006 12:57 pm
Contact:

Re: Oops - Database Down

Post by James N » Wed Oct 10, 2007 10:35 am

Great MOD. I know a lot of members are frightened by the 'critical error' message
Apolloneos wrote: Also, when the database is down, the oops_mail_sent.txt takes the value 1. Must we change it to 0 when the database is ok, or not?
I wondered that as well.

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Oops - Database Down

Post by igorw » Thu Nov 29, 2007 6:46 pm

Apolloneos wrote:How can the email be sent to 2 administrators?
You could do this... find:

Code: Select all

$admin_email = 'someone@somewhere.com';
After, add:

Code: Select all

$admin_emails = array('someone@somewhere.com', 'someoneelse@somewhere.com');
Find:

Code: Select all

if ( @mail ($admin_email, "$site_name - $page_title", $email_msg, $email_headers) )
Before, add:

Code: Select all

		foreach ($admin_emails as $e)
		{
			@mail($admin_email, "$site_name - $page_title", $email_msg, $email_headers)
		}
Apolloneos wrote:Also, when the database is down, the oops_mail_sent.txt takes the value 1. Must we change it to 0 when the database is ok, or not?
Yes, else no mail will be sent out next time ;)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Apolloneos
Registered User
Posts: 46
Joined: Sat Nov 25, 2006 6:58 pm
Location: Hellas
Contact:

Re: Oops - Database Down

Post by Apolloneos » Sun Dec 02, 2007 11:23 pm

I did it, but it does not work. It gives a white page.
Also, how can i change the coding of the email?

User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Oops - Database Down

Post by igorw » Mon Dec 03, 2007 3:59 pm

Ooh, it has to be:

Code: Select all

@mail($admin_email, "$site_name - $page_title", $email_msg, $email_headers);
There was a missing ; at the end. And what do you mean by coding? Encoding? Why do you need this?
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Apolloneos
Registered User
Posts: 46
Joined: Sat Nov 25, 2006 6:58 pm
Location: Hellas
Contact:

Re: Oops - Database Down

Post by Apolloneos » Tue Dec 04, 2007 1:18 pm

Yes, i mean the encoding of the email. I need this, because i translated the message to Greek.

Apolloneos
Registered User
Posts: 46
Joined: Sat Nov 25, 2006 6:58 pm
Location: Hellas
Contact:

Re: Oops - Database Down

Post by Apolloneos » Wed Dec 05, 2007 10:46 pm

Now it works, but it sends the email only to the first administrator 3 times.

Post Reply

Return to “[2.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 5 guests