diff --git a/phpBB/common.php b/phpBB/common.php index 44066cb6a8..00d4fa066f 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -65,6 +65,7 @@ include('includes/auth.'.$phpEx); include('includes/functions.'.$phpEx); include('includes/db.'.$phpEx); + // Obtain and encode users IP //$get_user_ip = ; $user_ip = encode_ip(($HTTP_X_FORWARDED_FOR) ? $HTTP_X_FORWARDED_FOR : $REMOTE_ADDR); @@ -89,7 +90,7 @@ if(!$result = $db->sql_query($sql)) $board_config['default_lang'] = "english"; $board_config['gzip_compress'] = 0; - message_die(SQL_QUERY, "Could not query config information", "", __LINE__, __FILE__); + message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); } else { diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 8f4ba92153..cc93c5f4b6 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -37,8 +37,8 @@ define(USER, 0); define(ADMIN, 1); // Topic state -define(UNLOCKED, 0); -define(LOCKED, 1); +define(TOPIC_UNLOCKED, 0); +define(TOPIC_LOCKED, 1); // Topic types define(POST_NORMAL, 0); @@ -46,22 +46,22 @@ define(POST_STICKY, 1); define(POST_ANNOUNCE, 2); define(POST_GLOBAL_ANNOUNCE, 3); -// Ban time types -define(SECONDS, 1); -define(MINUTES, 2); -define(HOURS, 3); -define(DAYS, 4); -define(YEARS, 5); +// SQL codes +define(BEGIN_TRANSACTION, 1); +define(END_TRANSACTION, 2); // Error codes +define(GENERAL_MESSAGE, 200); +define(GENERAL_ERROR, 202); +define(CRITICAL_MESSAGE, 203); +define(CRITICAL_ERROR, 204); + define(SQL_CONNECT, 1); define(BANNED, 2); define(QUERY_ERROR, 3); define(SESSION_CREATE, 4); define(NO_TOPICS, 5); -define(GENERAL_ERROR, 6); define(LOGIN_FAILED, 7); -define(GENERAL_MESSAGE, 10); // Private messaging define(PRIVMSGS_READ_MAIL, 0); @@ -128,7 +128,8 @@ define('GROUPS_TABLE', $table_prefix.'groups'); define('POSTS_TABLE', $table_prefix.'posts'); define('POSTS_TEXT_TABLE', $table_prefix.'posts_text'); define('PRIVMSGS_TABLE', $table_prefix.'privmsgs'); -define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text'); +define('PRIVMSGS_TEXT_TABLE', $table_prefix.'privmsgs_text'); +define('PRIVMSGS_IGNORE_TABLE', $table_prefix.'privmsgs_ignore'); define('RANKS_TABLE', $table_prefix.'ranks'); define('SESSIONS_TABLE', $table_prefix.'session'); define('THEMES_TABLE', $table_prefix.'themes'); @@ -137,4 +138,5 @@ define('USER_GROUP_TABLE', $table_prefix.'user_group'); define('USERS_TABLE', $table_prefix.'users'); define('WORDS_TABLE', $table_prefix.'words'); define('PRUNE_TABLE', $table_prefix.'forum_prune'); -?> + +?> \ No newline at end of file diff --git a/phpBB/includes/db.php b/phpBB/includes/db.php index 3707299d56..916aa7e0d3 100644 --- a/phpBB/includes/db.php +++ b/phpBB/includes/db.php @@ -42,10 +42,9 @@ switch($dbms) // Make the database connection. $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, false); -if(!$db) +if(!$db->db_connect_id) { - $db_error = $db->sql_error(); - error_die(SQL_CONNECT, $db_error['message']); + message_die(CRITICAL_ERROR, "Could not connect to the database"); } ?> \ No newline at end of file