If you've ever had your site go down you've probably be confronted with that really ugly database connection error page. here is a way to make it at least look a bit better.
I was inspired to write this after reading this thread:
http://forums.postnuke.com/index.php?name=
PNphpBB2&file=viewtopic&t=38078
Around line 435 in includes/pnAPI.php you'll find:
if (!
$dbh) { //$dbpass = ""; //die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg()); die("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>PostNuke powered Website</title>\n</head>\n<body>\n<center>\n<h1>Problem in Database Connection</h1>\n<br /><br />\n<h5>This Website is powered by PostNuke</h5>\n<a href=\"http://www.postnuke.com\" target=\"_blank\"><img src=\"images/powered/postnuke.butn.gif\" border=\"0\" alt=\"Web site powered by PostNuke\" hspace=\"10\" /></a> <a href=\"http://php.weblogs.com/ADODB\" target=\"_blank\"><img src=\"images/powered/adodb2.gif\" alt=\"ADODB database library\" border=\"0\" hspace=\"10\" /></a><a href=\"http://www.php.net\" target=\"_blank\"><img src=\"images/powered/php2.gif\" alt=\"PHP Scripting Language\" border=\"0\" hspace=\"10\" /></a><br />\n<h5>Although this site is running the PostNuke software<br />it has no other connection to the PostNuke Developers.<br />Please refrain from sending messages about this site or its content<br />to the PostNuke team, the end will result in an ignored e-mail.</h5>\n</center>\n</body>\n</html>");
}
Here is how I changed mine:
if (!
$dbh) { //$dbpass = ""; //die("$dbtype://$dbuname:$dbpass@$dbhost/$dbname failed to connect" . $dbconn->ErrorMsg()); die("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>FirstEdge - undergoing scheduled maintainance operations</title>\n</head>\n<body bgcolor=\"#bdcede\">\n<center>\n<h1>FirstEdge.Com.au</h1><h3>is undergoing scheduled maintainance operations<br />We appologise for any inconvenience</h3>\n <img src=\"images/db_error/maintenance.gif\" border=\"0\" hspace=\"10\" / alt=\"FirstEdge.Com.au is undergoing scheduled maintainance operations\">\n<h3>We will be back online as soon as possible<br />please call back again soon.</h3>\n</center>\n</body>\n</html>");
}
Maybe that will help a bit with making things look a bit better when things get stuffed up.