################################################################# ## Title: customize the error message on wordpress ## Author: ejm (aka llizard) http://llizard.etherwork.net/cwc/ ## Date: 10 September 2007 ## ## OPEN IN A TEXT EDITOR AND SAVE AS wp-db_fix.php ## ## **NB** With 'AFTER, ADD', the code is to be added after the last ## line quoted in 'FIND'. ## ## With 'BEFORE, ADD', the code is to be added before the ## first line quoted in 'FIND'. ## ## With 'REPLACE WITH', the code quoted in 'FIND' is to be replaced ## completely with the quoted code in 'REPLACE WITH'. ## ## Version: 1.0.1 (wordpress 2.0.11) ## Files To Edit: wp-includes/wp-db.php ## ############################################################## ## For Security Purposes, Please Check: http://wordpress.org/ for the ## latest version of wordpress. Please note that this fix has not been ## put out by WordPress! The fix is put together as a result of reading ## the wordpress support forum (http://wordpress.org/support/topic/36534) ############################################################## ## Author Notes: ## ## This fix should be put in AFTER wordpress blog is successfully running. ## It is only for the occasional times that the host database cannot be ## contacted so that visitors will see the same style of page as expected ## ############################################################## ## History: ## ## 2006/04/02 - Version 1.0.0 (wordpress 2.0.2) ## - first release ## 2007/09/10 - Version 1.0.1 (wordpress 2.0.11) ## - confirms compatibility with 2.0.11 ## ############################################################## ## Before going further, back up wp-includes/wp-db.php ############################################################## # #-----[ OPEN ]--------------------------------------------- # wp-includes/wp-db.php # #-----[ FIND ]--------------------------------------------- # Line 45 $this->bail("

Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at $dbhost. This could mean your host's database server is down.

If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

"); # #-----[ REPLACE WITH ]--------------------------------------------- # # Note that apostrophes must be escaped within the HTML coding! # Instead of "can't", "host's" or "you're", add backslashes before each # apostrophe: "can\'t", "host\'s" or "you\'re" # $this->bail('

Error establishing a database connection

The database server for [yourwordpressblogname] at [yourdomain.com] ($dbhost) cannot be contacted. It is currently under maintenance and should be available soon

In the meantime, please look through other areas of [yourdomainname.com]

'); # #-----[ FIND ]--------------------------------------------- # Line 305 function bail($message) { // Just wraps errors in a nice header and footer if ( !$this->show_errors ) return false; header( 'Content-Type: text/html; charset=utf-8'); echo << WordPress › Error # #-----[ REPLACE WITH ]--------------------------------------------- # function bail($message) { // Just wraps errors in a nice header and footer if ( !$this->show_errors ) return false; header( 'Content-Type: text/html; charset=utf-8'); echo << [yourdomain.com] - [yourblogname]: WordPress › Error
Your Header goes here
# #-----[ FIND ]--------------------------------------------- # echo $message; echo ""; # #-----[ REPLACE WITH ]--------------------------------------------- # echo $message . "
"; echo <<Your Footer goes here

Perhaps you'd like to add a link to wordpress support as well.

FOOT; echo ""; # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # End