############################################################## 
## MOD Title:          Upgrade to Signatures control 1.2.2
## MOD Author:         -=ET=- < space_et@tiscali.fr > (n/a) http://www.golfexpert.net/phpbb
## MOD Description:    This MOD will allow you to upgrade your
##                     Signatures control MOD from 1.2.1
##                     to 1.2.2
## MOD Version:        1.0.0
## MOD Compatibility:  2.0.6->2.0.15 (prior release not tested)
## 
## Installation Level: Easy
## Installation Time:  5 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      3
##      admin/admin_board.php
##      admin/admin_users.php
##      includes/usercp_register.php
##
## Included Files:     6
##      root/language/lang_dutch/lang_sig_control.php
##      root/language/lang_english/lang_sig_control.php
##      root/language/lang_french/lang_sig_control.php
##      root/language/lang_german/lang_sig_control.php
##      root/language/lang_portuguese/lang_sig_control.php
##      root/language/lang_russian/lang_sig_control.php
##
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## 
## Signatures control 1.2.1 needs to be already installed!!!
##
## For the other author notes, please read the ones on the
## full install MOD in the root dir of this MOD archive.
##
##############################################################
## MOD History: 
## 
##   2005-06-04 - Version 1.0.1
##      - Fix a FIND searching a wrong string ("!" missing)
## 
##   2005-05-28 - Version 1.0.0
##      - Initial release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ COPY ]------------------------------------------------ 
#
copy root/language/lang_english/lang_sig_control.php to language/lang_english/lang_sig_control.php

#
# Warning! At the present time, the current release of EM is
# not able to install automatically another language than English.
# This gap will be solved in the future but in the meantime, if
# you need to install any other language than English provides
# with this MOD, please copy the corresponding language file
# manually to switch with the English file duplicated in every
# language directory by EM:
# copy root/language/lang_xxxxx/lang_sig_control.php to language/lang_xxxxx/lang_sig_control.php
#

# 
#-----[ OPEN ]------------------------------------------------ 
# 
admin/admin_board.php

# 
#-----[ FIND ]------------------------------------------------
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD

# 
#-----[ REPLACE WITH ]----------------------------------------
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include_once($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD
# 
#-----[ OPEN ]------------------------------------------------ 
# 
admin/admin_users.php 

# 
#-----[ FIND ]------------------------------------------------
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD

# 
#-----[ REPLACE WITH ]----------------------------------------
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include_once($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD
# 
#-----[ FIND ]------------------------------------------------
# 
if ($signature != '')

# 
#-----[ BEFORE, ADD ]-----------------------------------------
#

// Start add - Signatures control MOD
/* Unable signature length control when modified in the ACP
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
		$error_msg .=  ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long'];
	}
}

# 
#-----[ AFTER, ADD ]------------------------------------------
#

// Start add - Signatures control MOD
Unable signature length control when modified in the ACP */
// End add - Signatures control MOD

# 
#-----[ OPEN ]------------------------------------------------ 
# 
includes/usercp_register.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD

# 
#-----[ REPLACE WITH ]----------------------------------------
# 
// Start add - Signatures control MOD
if ( !file_exists(@phpbb_realpath($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx)) ) 
{ 
	include_once($phpbb_root_path . 'language/lang_english/lang_sig_control.' . $phpEx); 
} else 
{ 
	include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_sig_control.' . $phpEx); 
} 
// End add - Signatures control MOD
# 
#-----[ FIND ]------------------------------------------------
# 
if ( strlen($signature) > $board_config['max_sig_chars'] && !$board_config['max_sig_chars'] )

# 
#-----[ REPLACE WITH ]----------------------------------------
#
// Start replacement - Signatures control MOD
$signature_no_bbcode = preg_replace("#\[img\].*?\[/img\]|\[\/?(size.*?|b|i|u|color.*?|quote.*?|code|list.*?|url.*?)\]#si", "", $signature);
if ( strlen($signature_no_bbcode) > $board_config['max_sig_chars'] && $board_config['max_sig_chars'] )
// End replacement - Signatures control MOD
# 
#-----[ FIND ]------------------------------------------------
# 
$signature_no_url = preg_replace("#\[img\].*?\[/img\]|\[\/?(size.*?|b|i|u|color.*?|quote.*?|code|list.*?|url.*?)\]#si", "", $signature);
$signature_splited = preg_split("/[\s,]+/", $signature_no_url);

# 
#-----[ REPLACE WITH ]----------------------------------------
#
$signature_no_bbcode = preg_replace("#\[img\].*?\[/img\]|\[\/?(size.*?|b|i|u|color.*?|quote.*?|code|list.*?|url.*?)\]#si", "", $signature);
$signature_splited = preg_split("/[\s,]+/", $signature_no_bbcode);
# 
#-----[ SAVE/CLOSE ALL FILES ]-------------------------------- 
# 
# EoM