##############################################################
## MOD Title: Automatic Database Backup (rus)
## MOD Author: kkroo < princeomz2004@hotmail.com > (Omar Ramadan) phpbb-login.sourceforge.net
## MOD Description: 	         () 
##				  .       
##				       ,    
##				  gzip.       
##				email /    FTP (    cache/auto_backup/ 
##				  ).       ,   
##				 cron  .  1.0.2(rus)   phpBB.2.0.21.
## 
## MOD Version: 1.0.2 (rus)
## 
## Installation Level: Easy
## Installation Time: 7 minutes
## Files To Edit: common.php
## 			includes/constants.php
##                templates/subSilver/overall_footer.tpl
##                templates/subSilver/simple_footer.tpl
## 
## Included Files: 9
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: If you would like a Gmail account to send your backups to, PM me and I will gladly send you an invite.
##############################################################
## MOD History:
## 
## 2007-3-30 - Version 1.0.2 (rus)
##      - Translating un Russian.
##
## 2007-2-01 - Version 1.0.2
##      - Fixed the bug in which the cron doesnt work on the last day of the month.
## 
## 2007-1-31 - Version 1.0.1
##      - Re-added the feature that disables the board during backup
## 
## 2006-11-13 - Version 1.0.0
##      - Fixed the bug where the mod would stop making backups at the end of a month with 31 days
##      - Added the ability to keep a certain amount of backups in backups/ it will delete the oldest backup on the creation of a new one
##      - Added the ability to exclude the search tables and other tables from the backup
##      - Instead of having the backup time generated on every load of cron.php, the generated time is now stored in cache
## 
## 2006-10-13 - Version 0.9.0
## Changed language entries and added support for databases greater that the php memory limit.
## 
## 2006-09-25 - Version 0.8.2
## Added a security feature to add a random string into the file name. I also added the file backup in the contrib directory.
## 
## 2006-08-31 - Version 0.8.0
## Instead of including includes/cron.php in page_header.php it is now an image in the footer of every page. Backup skill level is now a setting that is saved in the database. Fixed a template error in the administration panel for phpBB only backups. The mod now creates the ftp directory you specify if it doesnt exist.
## 
## 2006-07-9 - Version 0.7.1
## Fixed lang error in the admin panel.
##
## 2006-07-3 - Version 0.7.0
## Made some changes to the script so that it stays under the php memory limit for large databases.
##
## 2006-06-16 - Version 0.6.2
## Fixed a MAJOR bug that posted the link to the backup in posts due to a variable used in posts.
##
## 2006-06-13 - Version 0.6.1
## Added a line in the message recieved telling if the script saved the file in the backups directory.
##
## 2006-06-12 - Version 0.6.0
## Added the abilty to define if the backups will be save to the backups directory or be made into a temporary directory.
## 
## 2006-06-11 - Version 0.5.1
## Found some hard-coded english in auto_backup.php, changed them to language variables, also fixed an error in the admin panel.
## 
## 2006-06-10 - Version 0.5.0
## Added FTP support and enhanced the admin panel. I also fixed the end of the month bug.
## 
## 2006-05-31 - Version 0.4.0
## Now you can send mails via smtp, now in beta stage.
##
## 2006-05-22 - Version 0.3.1
## Fixed up a few bugs with enabling/disabling board and updating last run time and the emailing of errors.
## 
## 2006-05-22 - Version 0.3.0
## Fixed up a few bugs and enhanced the admin panel.
## 
## 2006-05-11 - Version 0.2.0
## Send email error reports.
## 
## 2006-04-15 - Version 0.1.3
## Fixed the get_table_def error.
## 
## 2006-04-14 - Version 0.1.2
## Fixed the file time error (pointed out by raymondl2).
## 
## 2006-04-13 - Version 0.1.1
## Fixed the message_die() error (pointed out by raymondl2).
## 
## 2006-04-01 - Version 0.1.0
## Added an option of choosing if you want a complete backup, or partial, and added advanced users fields in the admin panel. Along with that, while the backup is being created, the board is disabled so it will not cause a server overload.
## 
## 2006-03-23 - Version 0.0.1
## Initial Release
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################

#
#-----[ COPY ]------------------------------------------
#
copy root/cron.php to cron.php
copy root/admin/admin_backup.php to admin/admin_backup.php
copy root/includes/cron.php to includes/cron.php
copy root/includes/auto_backup.php to includes/auto_backup.php
copy root/templates/subSilver/admin/admin_backup.tpl to templates/subSilver/admin/admin_backup.tpl
copy root/backups/index.htm to backups/index.htm
copy root/cache/auto_backup/index.htm to cache/auto_backup/index.htm
copy root/language/lang_english/lang_auto_backup.php to language/lang_english/lang_auto_backup.php
copy root/language/lang_russian/lang_auto_backup.php to language/lang_russian/lang_auto_backup.php

#
#-----[ OPEN ]------------------------------------------
#
common.php
#
#-----[ FIND ]------------------------------------------
#
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") )

#
#-----[ REPLACE WITH ]------------------------------------------
#
if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") && !defined("IN_CRON") )

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
// Table names
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Automatic DB backup Mod
define('BACKUP_TABLE', $table_prefix.'backup');

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
<div align="center"><span class="copyright"><br />{ADMIN_LINK}<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Automatic Database Backup Mod By Omar Ramadan http://phpbb-login.sourceforge.net -->
<a href="http://phpbb-login.sourceforge.net"><img src="cron.php" width="1" height="1" alt="" border="0"/></a>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/simple_footer.tpl
#
#-----[ FIND ]------------------------------------------
#
<div align="center"><span class="copyright"><br />
#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- Automatic Database Backup Mod By Omar Ramadan http://phpbb-login.sourceforge.net -->
<!-- If you liked this mod, add text below to make this a visible link -->
<a href="http://phpbb-login.sourceforge.net"><img src="cron.php" width="1" height="1" alt="" border="0"/></a>

#
#-----[ SQL ]------------------------------------------
#
# Change phpbb_backup to whatever your phpBB database extension is
CREATE TABLE `phpbb_backup` (
	`backup_skill` int(1)  NOT NULL,
	`email_true` int(1)  NOT NULL,
	`email` text  NOT NULL,
	`ftp_true` int(1)  NOT NULL,
	`ftp_server` text  NOT NULL,
	`ftp_user_name` text  NOT NULL,
	`ftp_user_pass` text  NOT NULL,
	`ftp_directory` text  NOT NULL,
	`write_backups_true` int(1)  NOT NULL,
	`files_to_keep` varchar(255) NOT NULL,
	`cron_time` text  NOT NULL,
	`delay_time` text  NOT NULL,
	`backup_type` text  NOT NULL,
	`phpbb_only` int(1)  NOT NULL,
	`no_search` int(1) NOT NULL,
	`ignore_tables` text NOT NULL,	
	`last_run` int(11) NOT NULL,
	`finished` int(1) NOT NULL
);
#
#-----[ SQL ]------------------------------------------
#
# Change phpbb_backup to whatever your phpBB database extension is
INSERT INTO `phpbb_backup` VALUES (0, 1, 'youremail@domain.ext, yourotheremail@anotherdomain.ext', 1, 'ftp.server.com', 'ftp_username', 'ftp_password', '/backups', '1', '-1', '0    0    *    *    *', '120', 'full', 0, 0, 'phpbb_ignore_me, separate_tables_with_a_comma_and_space, ignored, ignore_me_too', 1143162120, 0);
#
#-----[ DIY INSTRUCTIONS ]------------------------------------------
#
CHMOD the newly created directory backups/ to 777 and cache/auto_backup/ to 777
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
