############################################################## 
## MOD Title: DB Maintenance
## MOD Author: PhilippK < phpBB2005 <at> kordowich.net > (Philipp Kordowich) http://phpbb.kordowich.net/
## MOD Description: This Mod checks and fixes inconsistencies and errors in the database  
## MOD Version: 1.3.1
## 
## Installation Level: Easy
## Installation Time: 5 Minutes 
## Files To Edit: language/lang_english/lang_admin.php
## Included Files: admin_db_maintenance.php,
## dbmtnc_config_body.tpl,
## dbmtnc_confirm_body.tpl,
## dbmtnc_list_body.tpl,
## dbmtnc_statistic_body.tpl,
## erc.php,
## functions_dbmtnc.php,
## lang_dbmtnc.php,
## lang_dbmtnc_ger.php,
## update_db_for_dbmtnc.php 
############################################################## 
## For Security Purposes, Please Check: http://phpbb.kordowich.net/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum.
############################################################## 
## Author Notes:
## Read README.txt for further information
## For security reasons you should read the section 'Emergency Recovery Console' before
## uploading erc.php to your server.
############################################################## 
## MOD History: 
## Read README.txt for mod history
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 


#
#-----[ SQL ]-------------------------------------------------
#

# If you use a MySQL-Database, you can use the included script-file 'update_db_for_dbmtnc.php'
# (included in files-folder) to update your database. This script will use the right prefix for
# your tabel, so you don't have to care about these things. To exececute it, just copy it to the
# phpBB-directory of your forum (the directory where you can find the config.php) an execute it by
# calling it with your browser.
# It's recomended to remove the file afterwards from the server for security reasons.
#
# If you do not want to use this script, you have to execute these SQL-Commands. Please keep
# in mind that you need to change the tabel-prefixes if you didn't use 'phpbb'. It may be
# necessary to change the SQL-commands depending on the prefix you use.
#
# When Updating from version 1.2.1 or newer, you do not need to run these commands or the script.

DELETE FROM phpbb_config WHERE config_name = 'index_rebuild_position';
DELETE FROM phpbb_config WHERE config_name = 'index_rebuild_end_position';
DELETE FROM phpbb_config WHERE config_name = 'index_rebuild_postlimit';
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuild_end', '0');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuild_pos', '-1');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_maxmemory', '500');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_minposts', '3');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_php3only', '0');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_php3pps', '1');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_php4pps', '8');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_timelimit', '240');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_rebuildcfg_timeoverwrite', '0');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_disallow_postcounter', '0');
INSERT IGNORE INTO phpbb_config (config_name, config_value) VALUES ('dbmtnc_disallow_rebuild', '0');

# 
#-----[ COPY ]------------------------------------------------
# 
copy files/admin_db_maintenance.php to admin/admin_db_maintenance.php
copy files/dbmtnc_config_body.tpl to templates/subSilver/admin/dbmtnc_config_body.tpl
copy files/dbmtnc_confirm_body.tpl to templates/subSilver/admin/dbmtnc_confirm_body.tpl
copy files/dbmtnc_list_body.tpl to templates/subSilver/admin/dbmtnc_list_body.tpl
copy files/dbmtnc_statistic_body.tpl to templates/subSilver/admin/dbmtnc_statistic_body.tpl
copy files/erc.php to admin/erc.php
copy files/functions_dbmtnc.php to includes/functions_dbmtnc.php
copy files/lang_dbmtnc.php to language/lang_english/lang_dbmtnc.php
# For German version only:
# copy files/lang_dbmtnc_ger.php to language/lang_german/lang_dbmtnc.php


# 
#-----[ OPEN ]------------------------------------------------
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------------
# 
$lang['Restore_DB'] = 'Restore Database';

# 
#-----[ AFTER, ADD ]------------------------------------------
# 
$lang['DB_Maintenance'] = 'Database Maintenance';

# For German version only:
# # 
# #-----[ OPEN ]------------------------------------------------
# # 
# language/lang_german/lang_admin.php
# 
# # 
# #-----[ FIND ]------------------------------------------------
# # 
# $lang['Restore_DB'] = 'Datenbank wieder herstellen';
# 
# # 
# #-----[ AFTER, ADD ]------------------------------------------
# # 
# $lang['DB_Maintenance'] = 'Datenbank-Wartung';

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
