################################################################# ## Title: customize the error message on phpBB ## Author: ejm (aka llizard) http://llizard.etherwork.net/cwc/ ## Date: 10 September 2007 ## ## OPEN THIS IN A TEXT EDITOR AND SAVE IT AS phpBB-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 (phpBB 2.0.22) ## Files To Edit: includes/db.php ## ############################################################## ## For Security Purposes, Please Check: http://www.phpbb.com/ for the ## latest version of phpBB. Please note that this fix has not been ## put out by phpBB! ############################################################## ## Author Notes: ## ## This fix should be put in AFTER phpBB 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: ## ## 2007/03/05 - Version 1.0.0 (phpBB 2.0.22) ## - first release ## 2007/09/10 - Version 1.0.1 (phpBB 2.0.22) ## - fixed error in the replacement coding for ## // Make the database connection ## ############################################################## ## Before going further, back up includes/db.php ############################################################## # #-----[ OPEN ]--------------------------------------------- # includes/db.php # #-----[ FIND ]--------------------------------------------- # Line 59-64 // Make the database connection. $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); if(!$db->db_connect_id) { message_die(CRITICAL_ERROR, "Could not connect to the database"); } # #-----[ REPLACE WITH ]--------------------------------------------- # # Note that you will need to replace [your domain name], [your phpbb # forum name], [your phpBB name], [your phpBB description] and # [yourdomain.com] with your own names. # // Make the database connection. $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); if(!$db->db_connect_id) { $header = <<
[your phpbb forum name] - no connection to database
HEADER; $errormessage = << no connection to database
Powered by phpBB2 [your phpBB name]
[your phpBB description]

Information

The database server for [your phpbb forum] on [your domain name] ($dbhost) cannot be contacted. In the meantime, please look at link.

You may wish to look at phpbb support as well.

Powered by phpBB © 2001, 2005 phpBB Group
{TRANSLATION_INFO}
MESSAGE; echo $header; message_die(CRITICAL_ERROR, $errormessage); } # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # End