############################################################## 
## MOD Title:          Signatures control
## MOD Author:         -=ET=- < space_et@tiscali.fr > (n/a) http://www.golfexpert.net/phpbb
## MOD Description:    This MOD lets admins set general rules to
##                     fully control what they allow or not for
##                     signatures. But they can disallow the signature
##                     or the controls for who they want too.
## MOD Version:        1.2.3
## MOD Compatibility:  2.0.6->2.0.15 (prior release not tested)
## 
## Installation Level: Moderate
## Installation Time:  15 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      9
##      posting.php
##      viewtopic.php
##      admin/admin_board.php
##      admin/admin_users.php
##      includes/usercp_avatar.php
##      includes/usercp_register.php
##      templates/subSilver/profile_add_body.tpl
##      templates/subSilver/admin/board_config_body.tpl
##      templates/subSilver/admin/user_edit_body.tpl
##
## Included Files:     7
##      root/admin/sig_reset.php
##      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: 
## 
## 1. EasyMOD
## -----------
## This MOD is compatible with EasyMOD of Nuttzy and can be
## installed by it but is not yet certified EMC (EasyMOD Compliant)!
## http://area51.phpbb.com/phpBB22/viewforum.php?sid=&f=15
##
## Warning 1! At the minimum, you need EasyMOD beta 1 (0.1.13) or
## more recent to install this MOD by EM!
##
## Warning 2! At the present time, EM is not able to install
## automatically other languages than English.
## This gap will be solved in future releases but in the meantime,
## if you need to install any other language than English provides
## with this MOD, please proceed manually (cf. comments in
## the COPY section).
##
## 2. MOD compatibility
## -----------
## - Profile Control Panel compatibility
## This MOD is not compliant and will not be compliant with
## the PCP (Profile Control Panel) MOD. On the other hand, it
## will be compliant with the UCP (User Control Panel) of
## phpBB 3.0.0 as soon as this release will be available.
## - Anti-Spam 1.1.1 compatibility
## These instructions as is are not compliant if Anti-Spam 1.1.1
## is already installed. To use this MOD with Anti-Spam 1.1.1,
## apply the instructions for viewtopic.php 4 times!
## You must find 4 times the code mentionned, and after each one
## add the new code mentionned!
##
## 4. php compatibility
## -----------
## Signatures control needs at least php 4.0.4 for the image
## size control as it uses 2 methodes:
## - one using getimagesize() which need php 4.0.5 and
##   "allow_url_fopen" enabled to support urls as image file path,
## - or another one using ImageCreateFromString() which need
##   php 4.0.4 and the GD module enabled.
## Moreover, image size control do not work with the
## ImageCreateFromString() method if the image to control has
## been generated by a php GD module (by a php script).
##
## 5. Official last version link
## -----------
## Meanwhile the phpBB group validation and as the MOD is not yet
## in the phpBB MOD database, check this official link for updates...
## http://www.golfexpert.net/phpBB
##
## 6. Warning!
## -----------
## In phpBB 2.0.6->2.0.15 (prior releases not tested) there is an issue
## when signatures are viewed in the ACP > User Admin > Management.
## The BBCodes [code] & [list] are not displayed correctly and
## if you submit the profile you will corrupt these BBCodes.
## So I strongly advise you to install the BBCodes & smilies enhancement
## MOD 1.2.0 to fix this issue...
## http://www.golfexpert.net/phpbb
##
##############################################################
## MOD History: 
## 
##   2005-06-04 - Version 1.2.3
##      - Fix unable signature length control when modified in
##        the ACP
##      - Fix 1.2.1->1.2.2 upgrade MOD
##
##   2005-05-28 - Version 1.2.2
##      - Unable signature length control when modified in the ACP
##      - Remove the BBcodes when signature length is controled
##      - Fix the Maximum signature length. Thanks Meithar!
##      - Fix language string sometimes not displayed in the ACP
##      - Add the German, Russian & Portuguese translations.
##        Thanks chybo, micron & cifroes!
##
##   2004-08-15 - Version 1.2.1
##      - SQL instructions now performed by EM beta 1 (0.1.13)
##        or more recent.
##
##   2004-05-30 - Version 1.2.0
##      - Add the possibility for admin to disallow the controls
##        or on the opposite the signature for who they want
##      - Add the Dutch translation by SNEEuWBAL. Thanks!
##      - Fix an issue during profile update when signatures was disabled
##
##   2004-02-05 - Version 1.1.0
##      - Add exotic BBCode control
##      - Add the possibility to disallow smilies in signatures only
##      - Add a button to reset all signatures
##      - Modify maxlength values in board_config_body.tpl
##      - Remove the "BBCodes on" list in the profile setting page
##      - Fix a FIND with 2 possibilities in admin/admin_board.php
##      - Fix of the signature error final test really applied :-(
##
##   2004-01-29 - Version 1.0.0
##      - Fix font size imposed issue
##      - Fix urls still clickable if no url BBcode was used
##        in the signature text.
##      - Fix signature error final test
##      - Code cleaned in admin/admin_board.php
##      - Use the SPAN instead of FONT tag
##      - English language entries enhanced by Narc0sis. Thanks!
##
##   2004-01-18 - Version 1.0.0 Release Candidate 3
##      - "Always attach my signature" choice in user's profiles is
##        no longuer displayed if signatures are disabled in the ACP
##      - "Attach signature" checkbox in posting.php is no longuer
##        displayed if signatures are disabled in the ACP
##      - Fix an issue in the avatar size control when the global
##        control is enabled and signature images size set to 0
##      - Add a new second image size and image file size control
##        method to support the case where "allow_url_fopen"
##        has been disabled by the host provider
##      - Add the warning about php requirement image control
##      - Improve image control loops
##      - Add the "Allow if impossible to control" feature to
##        choose if images must be allowed or not when image
##        size control is impossible
##      - Skip image size control if height and width limits
##        are both set to 0 (unlimited)
##      - Skip image files size control if set to 0 (unlimited)
##        and image+avatar files size control set to 0 too
##
##   2004-01-12 - Version 1.0.0 Release Candidate 2
##      - Add instructions to be compliant with Anti-Spam 1.1.1
##      - Fix an issue the size control of local avatar file to upload
##      - Fix an error in the instructions for usercp_avatar.php
##      - Fix an issue in the avatar size control when the global
##        control is enabled
##      - Fix avatar was not controled if there was no signature
##      - Enhance error messages about file size control
##      - Enhance avatar explain message
##
##   2004-01-10 - Version 1.0.0 Release Candidate 1
##      - Code the "Maximum total image+avatar files size" feature
##      - Add a feature to limit the number of lines
##      - Add a wordwrap feature for too long text added with no
##        space that can enlarge the posts table in the viewtopic page
##      - Add a feature to set a minimum font size
##      - Add the possibility to set unlimited signature length
##      - Signature field in user's profiles is no longuer displayed
##        if signatures are disabled in the ACP
##      - Check that every text box are set with a positive integers
##      - Check that no font size is larger than 29 (the phpBB limit)
##      - Check that min/max font sizes set are valid
##      - Check that imposed font size is larger or equal to 7
##      - Change the design of some fields settings
##
##   2004-01-07 - Version 0.1.0 Beta 1
##      - Initial beta release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ SQL ]-------------------------------------------------
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_lines', '5');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_wordwrap', '100');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_font_sizes', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_min_font_size', '7');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_font_size', '12');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_bold', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_italic', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_underline', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_colors', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_quote', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_code', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_list', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_url', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_images', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_images', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_img_height', '75');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_img_width', '500');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_on_max_img_size_fail', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_img_files_size', '10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_max_img_av_files_size', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_exotic_bbcodes_disallowed', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('sig_allow_smilies', '1');
ALTER TABLE phpbb_users ADD user_allowsignature TINYINT not null DEFAULT '1';

# 
#-----[ COPY ]------------------------------------------------ 
#
copy root/admin/sig_reset.php to admin/sig_reset.php
copy root/language/lang_english/lang_sig_control.php to language/lang_english/lang_sig_control.php

# Actualmente, EM no puede instalar automticamente
# otros lenguajes diferentes al Ingls.
# Esto ser resuelto en futuras versiones pero por ahora,
# si necesitas instalar algun otro lenguaje
# por favor realizalo manualmente.
# Copie el archivo de lenguaje correspondiente manualmente.
#

# 
#-----[ OPEN ]------------------------------------------------ 
#
posting.php

# 
#-----[ FIND ]------------------------------------------------
#
$user_sig = ( $userdata['user_sig'] != '' && $board_config['allow_sig']

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
$board_config['allow_sig']

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
 && $userdata['user_allowsignature']

# 
#-----[ FIND ]------------------------------------------------
#
$user_sig = ( $post_info['user_sig'] != '' && $board_config['allow_sig']

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
$board_config['allow_sig']

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
 && $userdata['user_allowsignature']

# 
#-----[ FIND ]------------------------------------------------
#
if( $user_sig != '' )
{
	$template->assign_block_vars('switch_signature_checkbox', array());

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
''

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
 && $board_config['allow_sig'] && $userdata['user_allowsignature']

# 
#-----[ OPEN ]------------------------------------------------ 
#
viewtopic.php 

# 
#-----[ FIND ]------------------------------------------------
#
# Advertencia! Estas instrucciones no son compatibles si el MOD Anti-Spam 1.1.1
# est instalado actualmente. Para usar este MOD con el MOD Anti-Spam 1.1.1, aplique
# las instrucciones "FIND+AFTER, ADD" 4 veces.
# Debes buscar 4 veces el cdigo mencionado, y luego de cada uno agregar el cdigo indicado
#
if ( $user_sig != '' && $user_sig_bbcode_uid != '' )
{

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

// Start add - Signatures control MOD
if ( $userdata['user_allowsignature'] != 2 && $board_config['sig_allow_font_sizes'] == 0 )
{
	$user_sig = '[size=' . $board_config['sig_max_font_size'] . ':' . $user_sig_bbcode_uid . ']' . $user_sig . '[/size:' . $user_sig_bbcode_uid . ']';
}
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
#
if ( $user_sig != '' )
{
$user_sig = make_clickable(

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
''

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
 && $board_config['sig_allow_url'] != 0

# 
#-----[ FIND ]------------------------------------------------
#
if ( $postrow[$i]['user_allowsmile'] && $user_sig != '' )

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
''

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
 && $board_config['sig_allow_smilies'] != 0

# 
#-----[ FIND ]------------------------------------------------
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# if ( $user_sig != '' )
# {
# 	$user_sig = '<br />_________________<br />' . str_replace("\n", "\n<br />\n", $user_sig);
# }
#
if ( $user_sig != '' )
{
	$user_sig =
}

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
''

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
 && $userdata['user_allowsignature'] != 0

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
}

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
 else $user_sig = '';

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

# 
#-----[ FIND ]------------------------------------------------
# 
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);

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

// 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 ]------------------------------------------------
# 
$sql = "UPDATE " . CONFIG_TABLE . " SET

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

// Start add - Signatures control MOD
$new['sig_allow_bold'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_bold']) ) ? 1 : 0;
$new['sig_allow_italic'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_italic']) ) ? 1 : 0;
$new['sig_allow_underline'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_underline']) ) ? 1 : 0;
$new['sig_allow_colors'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_colors']) ) ? 1 : 0;
$new['sig_allow_quote'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_quote']) ) ? 1 : 0;
$new['sig_allow_code'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_code']) ) ? 1 : 0;
$new['sig_allow_list'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_list']) ) ? 1 : 0;
$new['sig_allow_on_max_img_size_fail'] = ( htmlspecialchars($HTTP_POST_VARS['sig_allow_on_max_img_size_fail']) ) ? 1 : 0;

$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['max_sig_chars'])) ) ? '<br />' . $lang['Max_sig_length'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_lines'])) ) ? '<br />' . $lang['sig_max_lines'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_wordwrap'])) ) ? '<br />' . $lang['sig_wordwrap'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_min_font_size'])) || htmlspecialchars($HTTP_POST_VARS['sig_min_font_size'])>29 || eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_font_size'])) || htmlspecialchars($HTTP_POST_VARS['sig_max_font_size'])>29 ) ? '<br />' . $lang['sig_font_size_limit'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_images'])) ) ? '<br />' . $lang['sig_max_images'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_img_height'])) || eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_img_width'])) ) ? '<br />' . $lang['sig_max_img_size'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_img_files_size'])) ) ? '<br />' . $lang['sig_max_img_files_size'] : '' ;
$sig_config_error_list .= ( eregi("[^0-9]", htmlspecialchars($HTTP_POST_VARS['sig_max_img_av_files_size'])) ) ? '<br />' . $lang['sig_max_img_av_files_size'] : '' ;

if ( $sig_config_error_list != '' )
{
	message_die(GENERAL_MESSAGE, $lang['sig_config_error'] . '<br /><br />' . $lang['sig_config_error_int'] . $sig_config_error_list . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>"));
}

if ( htmlspecialchars($HTTP_POST_VARS['sig_min_font_size']) >= htmlspecialchars($HTTP_POST_VARS['sig_max_font_size']) && htmlspecialchars($HTTP_POST_VARS['sig_max_font_size']) != 0 )
{
	message_die(GENERAL_MESSAGE, $lang['sig_config_error'] . '<br /><br />' . sprintf($lang['sig_config_error_min_max'], htmlspecialchars($HTTP_POST_VARS['sig_min_font_size']), htmlspecialchars($HTTP_POST_VARS['sig_max_font_size'])) . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>"));
}

if ( htmlspecialchars($HTTP_POST_VARS['sig_allow_font_sizes']) == 0 && htmlspecialchars($HTTP_POST_VARS['sig_max_font_size']) < 7 && htmlspecialchars($HTTP_POST_VARS['sig_max_font_size']) > 29 )
{
	message_die(GENERAL_MESSAGE, $lang['sig_config_error'] . '<br /><br />' . sprintf($lang['sig_config_error_imposed'], htmlspecialchars($HTTP_POST_VARS['sig_max_font_size'])) . "<br /><br />" . sprintf($lang['Click_return_config'], "<a href=\"" . append_sid("admin_board.$phpEx") . "\">", "</a>"));
}
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# $sig_no = ( !$new['allow_sig'] ) ? "checked=\"checked\"" : "";
#
$sig_no = (

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

// Start add - Signatures control MOD
switch ( $new['sig_allow_font_sizes'] )
{ 
	case 1:
		$sig_allow_font_sizes_yes="checked=\"checked\"";
		break; 
	case 2:
		$sig_allow_font_sizes_max="checked=\"checked\"";
		break; 
	case 0:
		$sig_allow_font_sizes_imposed="checked=\"checked\"";
		break; 
} 

$sig_allow_bold_yes = ( $new['sig_allow_bold'] ) ? "checked=\"checked\"" : "";
$sig_allow_italic_yes = ( $new['sig_allow_italic'] ) ? "checked=\"checked\"" : "";
$sig_allow_underline_yes = ( $new['sig_allow_underline'] ) ? "checked=\"checked\"" : "";
$sig_allow_colors_yes = ( $new['sig_allow_colors'] ) ? "checked=\"checked\"" : "";

$sig_allow_quote_yes = ( $new['sig_allow_quote'] ) ? "checked=\"checked\"" : "";
$sig_allow_code_yes = ( $new['sig_allow_code'] ) ? "checked=\"checked\"" : "";
$sig_allow_list_yes = ( $new['sig_allow_list'] ) ? "checked=\"checked\"" : "";

$sig_allow_url_yes = ( $new['sig_allow_url'] ) ? "checked=\"checked\"" : "";
$sig_allow_url_no = ( !$new['sig_allow_url'] ) ? "checked=\"checked\"" : "";

$sig_allow_smilies_yes = ( $new['sig_allow_smilies'] ) ? "checked=\"checked\"" : "";
$sig_allow_smilies_no = ( !$new['sig_allow_smilies'] ) ? "checked=\"checked\"" : "";

$sig_allow_images_yes = ( $new['sig_allow_images'] ) ? "checked=\"checked\"" : "";
$sig_allow_images_no = ( !$new['sig_allow_images'] ) ? "checked=\"checked\"" : "";

$sig_allow_on_max_img_size_fail_yes = ( $new['sig_allow_on_max_img_size_fail'] ) ? "checked=\"checked\"" : "";

if( phpversion() < '4.0.4' || (ini_get('allow_url_fopen')==0 && function_exists('ImageCreateFromString') == false) )
{
	if( phpversion() < '4.0.4' )
	{
		$l_explain = "php < 4.0.4";
	} elseif( ini_get('allow_url_fopen')==0 && function_exists('ImageCreateFromString') == false )
	{
		$l_explain = "allow_url_fopen: off & ImageCreateFromString: off";
	} else
	{
		$l_explain = "";
	}
	$l_sig_max_img_size_explain = sprintf($lang['sig_max_img_size_explain3'], $l_explain);
} elseif( phpversion() >= '4.0.5' && ini_get('allow_url_fopen')==1 )
{
	$l_sig_max_img_size_explain = $lang['sig_max_img_size_explain1'];
} else
{
	if( phpversion() == '4.0.4' )
	{
		$l_explain = "php 4.0.4";
	} elseif( ini_get('allow_url_fopen')==0 )
	{
		$l_explain = "allow_url_fopen: off";
	} else
	{
		$l_explain = "";
	}
	$l_sig_max_img_size_explain = sprintf($lang['sig_max_img_size_explain2'], $l_explain);
}
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# "L_MAX_SIG_LENGTH_EXPLAIN" => $lang['Max_sig_length_explain'],
#
"L_MAX_SIG_LENGTH_EXPLAIN" =>

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

// Start add - Signatures control MOD
'L_SIG_SETTINGS' => $lang['sig_settings'],
'L_SIG_SETTINGS_EXPLAIN' => $lang['sig_settings_explain'],

'L_SIG_MAX_LINES' => $lang['sig_max_lines'],
'L_SIG_WORDWRAP' => $lang['sig_wordwrap'],
'L_SIG_ALLOW_FONT_SIZES' => $lang['sig_allow_font_sizes'],
'L_SIG_ALLOW_FONT_SIZES_YES' => $lang['sig_allow_font_sizes_yes'],
'L_SIG_ALLOW_FONT_SIZES_MAX' => $lang['sig_allow_font_sizes_max'],
'L_SIG_ALLOW_FONT_SIZES_IMPOSED' => $lang['sig_allow_font_sizes_imposed'],
'L_SIG_FONT_SIZE_LIMIT' => $lang['sig_font_size_limit'],
'L_SIG_FONT_SIZE_LIMIT_EXPLAIN' => $lang['sig_font_size_limit_explain'],
'L_SIG_MIN_FONT_SIZE' => $lang['sig_min_font_size'],
'L_SIG_MAX_FONT_SIZE' => $lang['sig_max_font_size'],
'L_SIG_TEXT_ENHANCEMENT' => $lang['sig_text_enhancement'],
'L_SIG_ALLOW_BOLD' => $lang['sig_allow_bold'],
'L_SIG_ALLOW_ITALIC' => $lang['sig_allow_italic'],
'L_SIG_ALLOW_UNDERLINE' => $lang['sig_allow_underline'],
'L_SIG_ALLOW_COLORS' => $lang['sig_allow_colors'],
'L_SIG_TEXT_PRESENTATION' => $lang['sig_text_presentation'],
'L_SIG_ALLOW_QUOTE' => $lang['sig_allow_quote'],
'L_SIG_ALLOW_CODE' => $lang['sig_allow_code'],
'L_SIG_ALLOW_LIST' => $lang['sig_allow_list'],
'L_SIG_ALLOW_URL' => $lang['sig_allow_url'],
'L_SIG_ALLOW_IMAGES' => $lang['sig_allow_images'],
'L_SIG_MAX_IMAGES' => $lang['sig_max_images'],
'L_SIG_MAX_IMG_SIZE' => $lang['sig_max_img_size'],
'L_SIG_MAX_IMG_SIZE_EXPLAIN' => $l_sig_max_img_size_explain,
'L_SIG_IMG_SIZE_LEGEND' => $lang['sig_img_size_legend'],
'L_SIG_ALLOW_ON_MAX_IMG_SIZE_FAIL' => $lang['sig_allow_on_max_img_size_fail'],
'L_SIG_MAX_IMG_FILES_SIZE' => $lang['sig_max_img_files_size'],
'L_SIG_MAX_IMG_AV_FILES_SIZE' => $lang['sig_max_img_av_files_size'],
'L_SIG_MAX_IMG_AV_FILES_SIZE_EXPLAIN' => $lang['sig_max_img_av_files_size_explain'],
'L_SIG_KBYTES' => $lang['sig_Kbytes'],
'L_SIG_EXOTIC_BBCODES_DISALLOWED' => $lang['sig_exotic_bbcodes_disallowed'],
'L_SIG_EXOTIC_BBCODES_DISALLOWED_EXPLAIN' => $lang['sig_exotic_bbcodes_disallowed_explain'],
'L_SIG_ALLOW_SMILIES' => $lang['sig_allow_smilies'],
'L_SIG_RESET' => $lang['sig_reset'],
'L_SIG_RESET_EXPLAIN' => $lang['sig_reset_explain'],
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# "SIG_SIZE" => $new['max_sig_chars'],
#
"SIG_SIZE" =>

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

// Start add - Signatures control MOD
'SIG_MAX_LINES' => $new['sig_max_lines'],
'SIG_WORDWRAP' => $new['sig_wordwrap'],
'SIG_ALLOW_FONT_SIZES_YES' => $sig_allow_font_sizes_yes,
'SIG_ALLOW_FONT_SIZES_MAX' => $sig_allow_font_sizes_max,
'SIG_ALLOW_FONT_SIZES_IMPOSED' => $sig_allow_font_sizes_imposed,
'SIG_MIN_FONT_SIZE' => $new['sig_min_font_size'],
'SIG_MAX_FONT_SIZE' => $new['sig_max_font_size'],
'SIG_ALLOW_BOLD_YES' => $sig_allow_bold_yes,
'SIG_ALLOW_ITALIC_YES' => $sig_allow_italic_yes,
'SIG_ALLOW_UNDERLINE_YES' => $sig_allow_underline_yes,
'SIG_ALLOW_COLORS_YES' => $sig_allow_colors_yes,
'SIG_ALLOW_QUOTE_YES' => $sig_allow_quote_yes,
'SIG_ALLOW_CODE_YES' => $sig_allow_code_yes,
'SIG_ALLOW_LIST_YES' => $sig_allow_list_yes,
'SIG_ALLOW_URL_YES' => $sig_allow_url_yes,
'SIG_ALLOW_URL_NO' => $sig_allow_url_no,
'SIG_ALLOW_IMAGES_YES' => $sig_allow_images_yes,
'SIG_ALLOW_IMAGES_NO' => $sig_allow_images_no,
'SIG_MAX_IMAGES' => $new['sig_max_images'],
'SIG_MAX_IMG_HEIGHT' => $new['sig_max_img_height'],
'SIG_MAX_IMG_WIDTH' => $new['sig_max_img_width'],
'SIG_ALLOW_ON_MAX_IMG_SIZE_FAIL_YES' => $sig_allow_on_max_img_size_fail_yes,
'SIG_MAX_IMG_FILES_SIZE' => $new['sig_max_img_files_size'],
'SIG_MAX_IMG_AV_FILES_SIZE' => $new['sig_max_img_av_files_size'],
'SIG_EXOTIC_BBCODES_DISALLOWED' => $new['sig_exotic_bbcodes_disallowed'],
'SIG_ALLOW_SMILIES_YES' => $sig_allow_smilies_yes,
'SIG_ALLOW_SMILIES_NO' => $sig_allow_smilies_no,

'U_SIG_RESET' => append_sid("./sig_reset.$phpEx?mode=confirm_all"),
// End add - Signatures control MOD

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

# 
#-----[ FIND ]------------------------------------------------
# 
require($phpbb_root_path . 'includes/functions_validate.'.$phpEx);

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

// 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 ]------------------------------------------------
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# $user_allowavatar = ( !empty($HTTP_POST_VARS['user_allowavatar']) ) ? intval( $HTTP_POST_VARS['user_allowavatar'] ) : 0;
#
$user_allowpm = ( !empty(

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

// Start add - Signatures control MOD
$user_allowsignature = ( !empty($HTTP_POST_VARS['user_allowsignature']) ) ? intval( $HTTP_POST_VARS['user_allowsignature'] ) : 0;
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
if ( strlen($sig_length_check) > $board_config['max_sig_chars'] )

# 
#-----[ IN-LINE FIND ]----------------------------------------
# 
$board_config['max_sig_chars']

# 
#-----[ IN-LINE REPLACE WITH ]--------------------------------
# 
999999999

# 
#-----[ FIND ]------------------------------------------------
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# $sql = "UPDATE " . USERS_TABLE . "
# 	SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" ...
#
$sql = "UPDATE " . USERS_TABLE . "
SET

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
$user_allowavatar

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
, user_allowsignature = $user_allowsignature

# 
#-----[ FIND ]------------------------------------------------
# 
$user_allowpm = $this_userdata['user_allow_pm'];

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

// Start add - Signatures control MOD
$user_allowsignature = $this_userdata['user_allowsignature'];
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
$s_hidden_fields .= '<input type="hidden" name="user_allowpm" value="' . $user_allowpm . '" />';

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

// Start add - Signatures control MOD
$s_hidden_fields .= '<input type="hidden" name="user_allowsignature" value="' . $user_allowsignature . '" />';
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# 'ALLOW_PM_NO' => (!$user_allowpm) ? 'checked="checked"' : '',
#
'ALLOW_PM_NO' =>

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

// Start add - Signatures control MOD
'ALLOW_SIGNATURE_YES_NOT_CONTROLED' => ($user_allowsignature == 2) ? 'checked="checked"' : '',
'ALLOW_SIGNATURE_YES_CONTROLED' => ($user_allowsignature == 1) ? 'checked="checked"' : '',
'ALLOW_SIGNATURE_NO' => ($user_allowsignature == 0) ? 'checked="checked"' : '',
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# 'L_ALLOW_PM' => $lang['User_allowpm'],
#
'L_ALLOW_PM' =>

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

// Start add - Signatures control MOD
'L_SIG_ALLOW_SIGNATURE' => $lang['sig_allow_signature'],
'L_SIG_YES_NOT_CONTROLED' => $lang['sig_yes_not_controled'],
'L_SIG_YES_CONTROLED' => $lang['sig_yes_controled'],
// End add - Signatures control MOD

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

# 
#-----[ FIND ]------------------------------------------------ 
#
$avatar_data .= @fread($fsock, $board_config['avatar_filesize']);

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Signatures control MOD
$avatar_data .= @fread($fsock, ( $board_config['sig_max_img_av_files_size'] ) ? $board_config['sig_max_img_av_files_size'] : $board_config['avatar_filesize']);
// End replacement - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------ 
#
if ( !$error && $avatar_filesize > 0

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
!$error &&

# 
#-----[ IN-LINE REPLACE WITH ]-------------------------------- 
#
(

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
['avatar_filesize']

# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
#
) || $board_config['sig_max_img_av_files_size']

# 
#-----[ FIND ]------------------------------------------------ 
#
if ( $avatar_filesize <= $board_config['avatar_filesize']

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
$avatar_filesize

# 
#-----[ IN-LINE BEFORE, ADD ]--------------------------------- 
#
(

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
#
> 0

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
) || $board_config['sig_max_img_av_files_size']

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
// Check and initialize some variables if needed
//

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

// 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 != '' )

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
''

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------------
#
 && $userdata['user_allowsignature'] == 1

# 
#-----[ FIND ]------------------------------------------------
# 
if ( strlen($signature) > $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 ]------------------------------------------------
# 
if ( $signature_bbcode_uid == '' )

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

// Start add - Signatures control MOD
	$sig_error_list = '';

	// BBCodes control
	$bbcode_error_list = '';
	$bbcode_error_list .= ( !$board_config['sig_allow_font_sizes'] && substr_count(strtolower($signature), '[/size]') > 0 ) ? '[size]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_bold'] && substr_count(strtolower($signature), '[/b]') > 0 ) ? '[b]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_italic'] && substr_count(strtolower($signature), '[/i]') > 0 ) ? '[i]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_underline'] && substr_count(strtolower($signature), '[/u]') > 0 ) ? '[u]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_colors'] && substr_count(strtolower($signature), '[/color]') > 0 ) ? '[color]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_quote'] && substr_count(strtolower($signature), '[/quote]') > 0 ) ? '[quote]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_code'] && substr_count(strtolower($signature), '[/code]') > 0 ) ? '[code]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_list'] && substr_count(strtolower($signature), '[/list]') > 0 ) ? '[list]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_url'] && substr_count(strtolower($signature), '[/url]') > 0 ) ? '[url]' : '';
	$bbcode_error_list .= ( !$board_config['sig_allow_images'] && substr_count(strtolower($signature), '[/img]') > 0 ) ? '[img]' : '';

	$exotic_bbcodes_list = explode(",", $board_config['sig_exotic_bbcodes_disallowed']);
	while ( list($bbckey, $exotic_bbcode) = @each($exotic_bbcodes_list) )
	{
		$exotic_bbcode = trim(strtolower($exotic_bbcode));
		if ( $exotic_bbcode != '' )
		{
			$bbcode_error_list .= ( substr_count(strtolower($signature), '[/'.$exotic_bbcode.']') > 0 ) ? '['.$exotic_bbcode.']' : '';
		}
	}

	if ( $bbcode_error_list != '' )
	{
		$error = TRUE;
		$sig_error_list .= '<br />' . sprintf($lang['sig_error_bbcode'], '<span style="color: #800000">' . $bbcode_error_list . '</span>');
	}

	// Number of lines control
	if ( $board_config['sig_max_lines'] )
	{
		if ( count(explode("\n", $signature)) > $board_config['sig_max_lines'] ) 
		{ 
			$error = TRUE;
			$sig_error_list .= '<br />' . sprintf($lang['sig_error_max_lines'], count(explode("\n", $signature)), $board_config['sig_max_lines']);
		}
	}

	// Wordwrap control
	if ( $board_config['sig_wordwrap'] )
	{
		$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);

		foreach($signature_splited as $key => $word)
		{
			$length = strlen($word);
			if( $length > $board_config['sig_wordwrap'] )
			{
				$words[$key] = $word;
			}
		}

		if ( count($words) ) 
		{ 
			$error = TRUE;
			$sig_error_list .= '<br />' . sprintf($lang['sig_error_wordwrap'], count($words), $board_config['sig_wordwrap']);
		}
	}

	// Font size limit control (imposed font size is managed in viewtopic.php)
	if ( $board_config['sig_allow_font_sizes'] == 2 )
	{
		if( preg_match_all("#\[size=([0-9]+?)\](.*?)\[/size\]#si", $signature, $sig_sizes_list) )
		{
			if ( $board_config['sig_min_font_size'] && min($sig_sizes_list[1]) < $board_config['sig_min_font_size'] )
			{
				$error = TRUE;
				$sig_error_list .= '<br />' . sprintf($lang['sig_error_font_size_min'], min($sig_sizes_list[1]), $board_config['sig_min_font_size']);
			}
			if ( $board_config['sig_max_font_size'] && max($sig_sizes_list[1]) > $board_config['sig_max_font_size'] )
			{
				$error = TRUE;
				$sig_error_list .= '<br />' . sprintf($lang['sig_error_font_size_max'], max($sig_sizes_list[1]), $board_config['sig_max_font_size']);
			}
		}
	}

	// Images control (except file the size error message)
	$total_image_files_size = 0;

	if( $board_config['sig_allow_images'] && preg_match_all("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#si", $signature, $sig_images_list) )
	{
		if( count($sig_images_list[0]) > $board_config['sig_max_images'] && $board_config['sig_max_images'] != 0 )
		{
			$error = TRUE;
			$sig_error_list .= '<br />' . sprintf($lang['sig_error_num_images'], count($sig_images_list[0]), $board_config['sig_max_images']);
		}

		for( $i = 0; $i < count($sig_images_list[0]); $i++ )
		{
			$image_url = $sig_images_list[1][$i].$sig_images_list[3][$i];

			preg_match('/^(http:\/\/)?([\w\-\.]+)\:?([0-9]*)\/(.*)$/', $image_url, $image_url_ary);

			if ( empty($image_url_ary[4]) )
			{
				$error = true;
				$sig_error_list .= '<br />' . $lang['Incomplete_URL'] . ': ' . '<span style="color: #800000">' . $image_url . '"</span>';
			} else
			{
				$image_size_control = false;
				if ( $board_config['sig_max_img_height'] != 0 || $board_config['sig_max_img_width'] != 0 )
				{
					usleep(1500);
					if ( list($image_width, $image_height) = @getimagesize($image_url) )
					{
						$image_size_control = true;
						if( ($board_config['sig_max_img_height'] != 0 && $image_height > $board_config['sig_max_img_height']) ||
						    ($board_config['sig_max_img_width'] != 0 && $image_width > $board_config['sig_max_img_width']) )
						{
							$error = TRUE;
							$sig_error_list .= '<br />' . sprintf($lang['sig_error_images_size'], '<span style="color: #800000">' . $image_url . '"</span>', $image_height, $image_width, ( $board_config['sig_max_img_height'] ) ? $board_config['sig_max_img_height'] : $lang['sig_unlimited'], ( $board_config['sig_max_img_width'] ) ? $board_config['sig_max_img_width'] : $lang['sig_unlimited']);
						}
					}
				}
	
				$image_data = '';
				$image_file_size_control = 0;
				if( $board_config['sig_max_img_files_size'] != 0 || $board_config['sig_max_img_av_files_size'] != 0 ||
					(($board_config['sig_max_img_height'] != 0 || $board_config['sig_max_img_width'] != 0) && $image_size_control == false) )
				{
					if( $image_fd = @fopen($image_url, "rb") )
					{
						while (!feof($image_fd))
						{
							$image_data .= fread($image_fd, 1024);
						}
						fclose($image_fd);

						$total_image_files_size += strlen($image_data);
						$image_file_size_control = 3;
					} else		
					{
						$base_get = '/' . $image_url_ary[4];
						$port = ( !empty($image_url_ary[3]) ) ? $image_url_ary[3] : 80;

						if ( !($image_fsock = @fsockopen($image_url_ary[2], $port, $errno, $errstr)) )
						{
							$error = true;
							$sig_error_list .= '<br />' . $lang['No_connection_URL'] . ': ' . '<span style="color: #800000">' . $image_url . '"</span>';
						} else
						{
							@fputs($image_fsock, "GET $base_get HTTP/1.1\r\n");
							@fputs($image_fsock, "HOST: " . $image_url_ary[2] . "\r\n");
							@fputs($image_fsock, "Connection: close\r\n\r\n");

							while( !@feof($image_fsock) )
							{
								$image_data .= @fread($image_fsock, 1024);
							}
							@fclose($image_fsock);		

							if ( preg_match('#Content-Length\: ([0-9]+)[^ /][\s]+#i', $image_data, $image_file_data) )
							{
								$total_image_files_size += $image_file_data[1]; 
								$image_file_size_control = 2;
							} else
							{
								$total_image_files_size += strlen($image_data)-307; 
								$image_file_size_control = 1;
							}
						}
					}
				}

				if( ($board_config['sig_max_img_height'] != 0 || $board_config['sig_max_img_width'] != 0) && $image_size_control == false )
				{
					if( $image_file_size_control == 2 )
					{
						$image_data = substr($image_data, strlen($image_data) - $image_file_data[1], $image_file_data[1]);
					}

					if( function_exists('ImageCreateFromString') )
					{
						if( $image_string = @ImageCreateFromString($image_data) )
						{
							$image_width = ImageSX($image_string);
							$image_height = ImageSY($image_string);

							if( ($board_config['sig_max_img_height'] != 0 && $image_height > $board_config['sig_max_img_height']) ||
							    ($board_config['sig_max_img_width'] != 0 && $image_width > $board_config['sig_max_img_width']) )
							{
								$error = TRUE;
								$sig_error_list .= '<br />' . sprintf($lang['sig_error_images_size'], '<span style="color: #800000">' . $image_url . '"</span>', $image_height, $image_width, ( $board_config['sig_max_img_height'] ) ? $board_config['sig_max_img_height'] : $lang['sig_unlimited'], ( $board_config['sig_max_img_width'] ) ? $board_config['sig_max_img_width'] : $lang['sig_unlimited']);
							}

							ImageDestroy($image_string);
						} else
						{
							if( $board_config['sig_allow_on_max_img_size_fail'] == 0 )
							{
								$error = TRUE;
								$sig_error_list .= '<br />' . sprintf($lang['sig_error_images_size_control'], '<span style="color: #800000">' . $image_url . '"</span>');
							}
						}
					}else
					{
						if( $board_config['sig_allow_on_max_img_size_fail'] == 0 )
						{
							$error = TRUE;
							$sig_error_list .= '<br />' . sprintf($lang['sig_error_images_size_control'], '<span style="color: #800000">' . $image_url . '"</span>');
						}
					}
				}
			}
		}
	}
}

if ( $signature != '' )
{
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
#
$avatar_sql = '';

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

// Start add - Signatures control MOD
if ( $board_config['sig_max_img_av_files_size'] != 0 && ($board_config['allow_avatar_upload'] || $board_config['allow_avatar_remote'] || $board_config['allow_avatar_local']) )
{
	if ( !empty($user_avatar_name) && $board_config['allow_avatar_upload'] )
	{
		$avatar_file_size = $user_avatar_size;
	} else
	{
		if ( !empty($user_avatar_upload) && $board_config['allow_avatar_upload'] )
		{
			$avatar_url = $user_avatar_upload;
		} elseif ( !empty($user_avatar_remoteurl) && $board_config['allow_avatar_remote'] )
		{
			$avatar_url = $user_avatar_remoteurl;
		} elseif ( !empty($user_avatar_local) && $board_config['allow_avatar_local'] )
		{
			$avatar_url = $board_config['avatar_gallery_path'] . '/' . $user_avatar_local;
		} elseif ( $user_avatar_type && !isset($HTTP_POST_VARS['avatardel']) )
		{
			switch( $user_avatar_type )
			{
				case USER_AVATAR_UPLOAD:
					$avatar_url = ( $board_config['allow_avatar_upload'] ) ? $board_config['avatar_path'] . '/' . $user_avatar : '';
					break;
				case USER_AVATAR_REMOTE:
					$avatar_url = ( $board_config['allow_avatar_remote'] ) ? $user_avatar : '';
					break;
				case USER_AVATAR_GALLERY:
					$avatar_url = ( $board_config['allow_avatar_local'] ) ? $board_config['avatar_gallery_path'] . '/' . $user_avatar : '';
					break;
			}
		} else
		{
			$avatar_url = '';	
		}

		if ( $avatar_url != '' )
		{
			preg_match('/^(http:\/\/)?([\w\-\.]+)\:?([0-9]*)\/(.*)$/', $avatar_url, $avatar_url_ary);

			if ( empty($avatar_url_ary[4]) )
			{
				$error = true;
				$sig_error_list .= '<br />' . $lang['Incomplete_URL'] . ': ' . '<span style="color: #800000">' . $avatar_url . '"</span>';
			} else
			{
				$avatar_data = '';

				if( $avatar_fd = @fopen($avatar_url, "rb") )
				{
					while (!feof($avatar_fd))
					{
						$avatar_data .= fread($avatar_fd, 1024);
					}
					fclose($avatar_fd);

					$avatar_file_size = strlen($avatar_data);
				} else		
				{
					$base_get = '/' . $avatar_url_ary[4];
					$port = ( !empty($avatar_url_ary[3]) ) ? $avatar_url_ary[3] : 80;

					if ( !($avatar_fsock = @fsockopen($avatar_url_ary[2], $port, $errno, $errstr)) )
					{
						$error = true;
						$sig_error_list .= '<br />' . $lang['No_connection_URL'] . ': ' . '<span style="color: #800000">' . $avatar_url . '"</span>';
					} else
					{
						@fputs($avatar_fsock, "GET $base_get HTTP/1.1\r\n");
						@fputs($avatar_fsock, "HOST: " . $avatar_url_ary[2] . "\r\n");
						@fputs($avatar_fsock, "Connection: close\r\n\r\n");

						while( !@feof($avatar_fsock) )
						{
							$avatar_data .= @fread($avatar_fsock, 1024);
						}
						@fclose($avatar_fsock);		

						if ( preg_match('#Content-Length\: ([0-9]+)[^ /][\s]+#i', $avatar_data, $avatar_file_data) )
						{
							$avatar_file_size = $avatar_file_data[1]; 
						} else
						{
							$avatar_file_size = strlen($avatar_data)-307; 
						}
					}
				}
			}
		}
	}		

	if( round(($total_image_files_size+$avatar_file_size)/1024, 2) > $board_config['sig_max_img_av_files_size'] )
	{
		$error = TRUE;
		$sig_error_list .= '<br />' . sprintf($lang['sig_error_img_av_files_size'], round($total_image_files_size/1024, 2), round($avatar_file_size/1024, 2), $board_config['sig_max_img_av_files_size']);
		$user_avatar_local = '';
	}
} else
{
	if( $board_config['sig_max_img_files_size'] != 0 && (round($total_image_files_size/1024, 2) > $board_config['sig_max_img_files_size']) )
	{
		$error = TRUE;
		$sig_error_list .= '<br />' . sprintf($lang['sig_error_img_files_size'], round($total_image_files_size/1024, 2), $board_config['sig_max_img_files_size']);
	}
}

if ( $error == TRUE && $sig_error_list )
{
	$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['sig_error'] . '<br />' . $sig_error_list;
}
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "

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

// Start add - Signatures control MOD
if ( $board_config['allow_sig'] && $userdata['user_allowsignature'] != 0 )
{
	$sig_update = "user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid',";
	$attachsig_update = "user_attachsig = $attachsig,";
} else
{
	$sig_update = "";
	$attachsig_update = "";
}
// End add - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace( ...
#
SET " . $username_sql . $passwd_sql .

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid',

# 
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
" . $sig_update . "

# 
#-----[ IN-LINE FIND ]----------------------------------------
#
user_attachsig = $attachsig,

# 
#-----[ IN-LINE REPLACE WITH ]--------------------------------
#
" . $attachsig_update . "

# 
#-----[ FIND ]------------------------------------------------
#
$bbcode_status = ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode']  ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Signatures control MOD
if ( $board_config['sig_max_lines'] )
{
	$sig_explain_max_lines = sprintf($lang['sig_explain_max_lines'], $board_config['sig_max_lines']);
} else
{
	$sig_explain_max_lines = '';
}

if ( $board_config['sig_allow_font_sizes'] == 2 && !(!$board_config['sig_min_font_size'] && !$board_config['sig_max_font_size']) )
{
	if ( $board_config['sig_min_font_size'] )
	{
		if ( $board_config['sig_max_font_size'] )
		{
			$sig_explain_font_size_limit = sprintf($lang['sig_explain_font_size_limit'], $board_config['sig_min_font_size'], $board_config['sig_max_font_size']);
		} else
		{
			$sig_explain_font_size_limit = sprintf($lang['sig_explain_font_size_limit'], $board_config['sig_min_font_size'], '29');
		}
	} else
	{
		$sig_explain_font_size_limit = sprintf($lang['sig_explain_font_size_max'], $board_config['sig_max_font_size']);
	}
} else
{
	$sig_explain_font_size_limit = '';
}

if ( $board_config['sig_allow_images'] )
{
	if ( $board_config['sig_max_images'] )
	{
		$sig_explain_images_limit = sprintf($lang['sig_explain_images_limit'], $board_config['sig_max_images'], ( $board_config['sig_max_img_height'] ) ? $board_config['sig_max_img_height'] : $lang['sig_explain_unlimited'], ( $board_config['sig_max_img_width'] ) ? $board_config['sig_max_img_width'] : $lang['sig_explain_unlimited'], ( $board_config['sig_max_img_av_files_size'] ) ? $board_config['sig_max_img_av_files_size'] : $board_config['sig_max_img_files_size']);
	} else
	{
		$sig_explain_images_limit = sprintf($lang['sig_explain_unlimited_images'] , ( $board_config['sig_max_img_height'] ) ? $board_config['sig_max_img_height'] : $lang['sig_explain_unlimited'], ( $board_config['sig_max_img_width'] ) ? $board_config['sig_max_img_width'] : $lang['sig_explain_unlimited'], ( $board_config['sig_max_img_av_files_size'] ) ? $board_config['sig_max_img_av_files_size'] : $board_config['sig_max_img_files_size']);
	}
} else
{
	$sig_explain_images_limit = $lang['sig_explain_no_image'];
}

if ( $board_config['sig_max_img_av_files_size'] )
{
	$sig_explain_images_limit .= $lang['sig_explain_avatar_included'];
}

$signature_explain = $lang['sig_explain'];

if ( $userdata['user_allowsignature'] != 2 )
{
	$signature_explain .= ' ' . sprintf($lang['sig_explain_limits'], $board_config['max_sig_chars'], $sig_explain_font_size_limit, $sig_explain_max_lines, $sig_explain_images_limit);

	if ( $board_config['sig_wordwrap'] )
	{
		$signature_explain .= ' ' . sprintf($lang['sig_explain_wordwrap'], $board_config['sig_wordwrap']);
	}
}

if ( $userdata['user_allowbbcode'] && $board_config['allow_bbcode']  )
{
	if (($board_config['sig_allow_font_sizes'] &&
	     $board_config['sig_allow_bold'] &&
	     $board_config['sig_allow_italic'] &&
	     $board_config['sig_allow_underline'] &&
	     $board_config['sig_allow_colors'] &&
	     $board_config['sig_allow_quote'] &&
	     $board_config['sig_allow_code'] &&
	     $board_config['sig_allow_list'] &&
	     $board_config['sig_allow_url'] &&
	     $board_config['sig_allow_images'] &&
	     $board_config['sig_exotic_bbcodes_disallowed']=='') || $userdata['user_allowsignature'] == 2)
	{
		$lang['sig_bbcodes_off'] .= $lang['sig_none'];
		$lang['sig_bbcodes_on'] .= $lang['sig_all'];
		$bbcode_status = sprintf($lang['sig_bbcodes_on'], '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>') . '<br />' . sprintf($lang['sig_bbcodes_off'], '', '');
	} else
	{
		$lang['sig_bbcodes_off'] .= '<span style="color: #800000">';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_font_sizes'] ) ? '[size]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_bold'] ) ? '[b]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_italic'] ) ? '[i]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_underline'] ) ? '[u]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_colors'] ) ? '[color]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_quote'] ) ? '[quote]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_code'] ) ? '[code]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_list'] ) ? '[list]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_url'] ) ? '[url]' : '';
		$lang['sig_bbcodes_off'] .= ( !$board_config['sig_allow_images'] ) ? '[img]' : '';

		$exotic_bbcodes_list = explode(",", $board_config['sig_exotic_bbcodes_disallowed']);
		while ( list($bbckey, $exotic_bbcode) = @each($exotic_bbcodes_list) )
		{
			$exotic_bbcode = trim(strtolower($exotic_bbcode));
			if ( $exotic_bbcode != '' )
			{
				$lang['sig_bbcodes_off'] .= '['.$exotic_bbcode.']';
			}
		}

		$lang['sig_bbcodes_off'] .= '</span>';
		$bbcode_status = sprintf($lang['sig_bbcodes_off'], '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>');
	}
} else
{
	$bbcode_status = $lang['sig_BBCodes_are_OFF'];
}

if ( $board_config['allow_sig'] && $userdata['user_allowsignature'] )
{
	$template->assign_block_vars('switch_signature_allowed', array());
}
// End replacement - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# $smilies_status = ( $userdata['user_allowsmile'] && $board_config['allow_smilies'] ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
#
$smilies_status = ( $userdata['user_allowsmile']

# 
#-----[ IN-LINE FIND ]----------------------------------------
# 
$board_config['allow_smilies']

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------------
# 
 && $board_config['sig_allow_smilies']

# 
#-----[ FIND ]------------------------------------------------
# 
'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'),

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Signatures control MOD
'BBCODE_STATUS' => $bbcode_status,
// End replacement - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $board_config['avatar_max_width'], $board_config['avatar_max_height'], (round($board_config['avatar_filesize'] / 1024))),

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Signatures control MOD
'L_AVATAR_EXPLAIN' => sprintf($lang['Avatar_explain'], $board_config['avatar_max_width'], $board_config['avatar_max_height'], ( $board_config['sig_max_img_av_files_size'] ) ? $board_config['sig_max_img_av_files_size'] : round($board_config['avatar_filesize']/1024) ),
// End replacement - Signatures control MOD

# 
#-----[ FIND ]------------------------------------------------
# 
'L_SIGNATURE_EXPLAIN' => sprintf($lang['Signature_explain'], $board_config['max_sig_chars']),

# 
#-----[ REPLACE WITH ]---------------------------------------- 
#

// Start replacement - Signatures control MOD
'L_SIGNATURE_EXPLAIN' => $signature_explain,
// End replacement - Signatures control MOD

# 
#-----[ OPEN ]------------------------------------------------ 
#
templates/subSilver/profile_add_body.tpl

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# <tr> 
#  <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
#
<tr> 
{L_SIGNATURE}

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

<!-- Start add - Signatures control MOD -->
<!-- BEGIN switch_signature_allowed -->
<!-- End add - Signatures control MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# 	<textarea name="signature"style="width: 300px"  rows="6" cols="30" class="post">{SIGNATURE}</textarea>
#  </td>
# </tr>
#
{SIGNATURE}
</td>
</tr>

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

<!-- Start add - Signatures control MOD -->
<!-- END switch_signature_allowed -->
<!-- End add - Signatures control MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# <tr> 
#  <td class="row1"><span class="gen">{L_ALWAYS_ADD_SIGNATURE}:</span></td>
#
<tr> 
{L_ALWAYS_ADD_SIGNATURE}

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

<!-- Start add - Signatures control MOD -->
<!-- BEGIN switch_signature_allowed -->
<!-- End add - Signatures control MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
#
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# 	<input type="radio" name="attachsig" value="0" {ALWAYS_ADD_SIGNATURE_NO} />
# 	<span class="gen">{L_NO}</span></td>
# </tr>
#
{ALWAYS_ADD_SIGNATURE_NO}
<span class="gen">{L_NO}</span></td>
</tr>

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

<!-- Start add - Signatures control MOD -->
<!-- END switch_signature_allowed -->
<!-- End add - Signatures control MOD -->

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/admin/board_config_body.tpl

# 
#-----[ FIND ]------------------------------------------------ 
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# 	<td class="row2"><input class="post" type="text" size="20" maxlength="255" name="smilies_path" value="{SMILIES_PATH}" /></td>
# </tr>
#
{SMILIES_PATH}
</tr>

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

<!-- Start add - Signatures control MOD -->
<tr>
	<td class="row1">{L_ALLOW_NAME_CHANGE}</td>
	<td class="row2"><input type="radio" name="allow_namechange" value="1" {NAMECHANGE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" {NAMECHANGE_NO} /> {L_NO}</td>
</tr>

<tr>
	<th class="thHead" colspan="2">{L_SIG_SETTINGS}</th>
</tr>

<tr>
	<td class="row2" colspan="2"><span class="gensmall">{L_SIG_SETTINGS_EXPLAIN}</span></td>
</tr>
<!-- End add - Signatures control MOD -->

# 
#-----[ FIND ]------------------------------------------------ 
# 
<tr>
<td class="row1">{L_ALLOW_NAME_CHANGE}</td>
<td class="row2"><input type="radio" name="allow_namechange" value="1" {NAMECHANGE_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" {NAMECHANGE_NO} /> {L_NO}</td>
</tr>

# 
#-----[ REPLACE WITH ]----------------------------------------
#

<!-- Start replacement - Signatures control MOD -->
<tr>
	<td class="row1">{L_SIG_MAX_LINES}</td>
	<td class="row2"><input type="text" name="sig_max_lines" value="{SIG_MAX_LINES}" maxlength="2" size="3" class="post" /></td>
</tr>

<tr>
	<td class="row1">{L_SIG_WORDWRAP}</td>
	<td class="row2"><input type="text" name="sig_wordwrap" value="{SIG_WORDWRAP}" maxlength="3" size="3" class="post" /></td>
</tr>

<tr> 
	<td class="row1">{L_SIG_ALLOW_FONT_SIZES}</td>
	<td class="row2"><input type="radio" name="sig_allow_font_sizes" value="1" {SIG_ALLOW_FONT_SIZES_YES} /> {L_SIG_ALLOW_FONT_SIZES_YES}&nbsp; &nbsp;<input type="radio" name="sig_allow_font_sizes" value="2" {SIG_ALLOW_FONT_SIZES_MAX} /> {L_SIG_ALLOW_FONT_SIZES_MAX}&nbsp; &nbsp;<input type="radio" name="sig_allow_font_sizes" value="0" {SIG_ALLOW_FONT_SIZES_IMPOSED} /> {L_SIG_ALLOW_FONT_SIZES_IMPOSED}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_FONT_SIZE_LIMIT}<br /><span class="gensmall">{L_SIG_FONT_SIZE_LIMIT_EXPLAIN}</td>
	<td class="row2"><input type="text" name="sig_min_font_size" value="{SIG_MIN_FONT_SIZE}" maxlength="2" size="3" class="post" /> {L_SIG_MIN_FONT_SIZE} <input type="text" name="sig_max_font_size" value="{SIG_MAX_FONT_SIZE}" maxlength="2" size="3" class="post" /> {L_SIG_MAX_FONT_SIZE}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_TEXT_ENHANCEMENT}</td>
	<td class="row2"><input style="text-indent: 0px" type="checkbox" name="sig_allow_bold" value="1" {SIG_ALLOW_BOLD_YES}> {L_SIG_ALLOW_BOLD}<br />
			 <input type="checkbox" name="sig_allow_italic" value="1" {SIG_ALLOW_ITALIC_YES}> {L_SIG_ALLOW_ITALIC}<br />
			 <input type="checkbox" name="sig_allow_underline" value="1" {SIG_ALLOW_UNDERLINE_YES}> {L_SIG_ALLOW_UNDERLINE}<br />
			 <input type="checkbox" name="sig_allow_colors" value="1" {SIG_ALLOW_COLORS_YES}> {L_SIG_ALLOW_COLORS}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_TEXT_PRESENTATION}</td>
	<td class="row2"><input style="text-indent: 0px" type="checkbox" name="sig_allow_quote" value="1" {SIG_ALLOW_QUOTE_YES} /> {L_SIG_ALLOW_QUOTE}<br />
			 <input type="checkbox" name="sig_allow_code" value="1" {SIG_ALLOW_CODE_YES} /> {L_SIG_ALLOW_CODE}<br />
			 <input type="checkbox" name="sig_allow_list" value="1" {SIG_ALLOW_LIST_YES} /> {L_SIG_ALLOW_LIST}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_ALLOW_URL}</td>
	<td class="row2"><input type="radio" name="sig_allow_url" value="1" {SIG_ALLOW_URL_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="sig_allow_url" value="0" {SIG_ALLOW_URL_NO} /> {L_NO}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_ALLOW_IMAGES}</td>
	<td class="row2"><input type="radio" name="sig_allow_images" value="1" {SIG_ALLOW_IMAGES_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="sig_allow_images" value="0" {SIG_ALLOW_IMAGES_NO} /> {L_NO}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_MAX_IMAGES}</td>
	<td class="row2"><input type="text" name="sig_max_images" value="{SIG_MAX_IMAGES}" maxlength="2" size="3" class="post" /></td>
</tr>

<tr>
	<td class="row1">{L_SIG_MAX_IMG_SIZE}<br /><span class="gensmall">{L_SIG_MAX_IMG_SIZE_EXPLAIN}</span></td>
	<td class="row2"><input class="post" type="text" size="3" maxlength="4" name="sig_max_img_height" value="{SIG_MAX_IMG_HEIGHT}" /> x <input class="post" type="text" size="3" maxlength="4" name="sig_max_img_width" value="{SIG_MAX_IMG_WIDTH}"> {L_SIG_IMG_SIZE_LEGEND}<br />
			 <input type="checkbox" name="sig_allow_on_max_img_size_fail" value="1" {SIG_ALLOW_ON_MAX_IMG_SIZE_FAIL_YES} /> {L_SIG_ALLOW_ON_MAX_IMG_SIZE_FAIL}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_MAX_IMG_FILES_SIZE}</td>
	<td class="row2"><input type="text" name="sig_max_img_files_size" value="{SIG_MAX_IMG_FILES_SIZE}" maxlength="3" size="3" class="post" /> {L_SIG_KBYTES}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_MAX_IMG_AV_FILES_SIZE}<br /><span class="gensmall">{L_SIG_MAX_IMG_AV_FILES_SIZE_EXPLAIN}</span></td>
	<td class="row2"><input type="text" name="sig_max_img_av_files_size" value="{SIG_MAX_IMG_AV_FILES_SIZE}" maxlength="3" size="3" class="post" /> {L_SIG_KBYTES}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_EXOTIC_BBCODES_DISALLOWED}<br /><span class="gensmall">{L_SIG_EXOTIC_BBCODES_DISALLOWED_EXPLAIN}</span></td>
	<td class="row2"><input type="text" name="sig_exotic_bbcodes_disallowed" value="{SIG_EXOTIC_BBCODES_DISALLOWED}" maxlength="255" size="40" class="post" /></td>
</tr>

<tr>
	<td class="row1">{L_SIG_ALLOW_SMILIES}</td>
	<td class="row2"><input type="radio" name="sig_allow_smilies" value="1" {SIG_ALLOW_SMILIES_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="sig_allow_smilies" value="0" {SIG_ALLOW_SMILIES_NO} /> {L_NO}</td>
</tr>

<tr>
	<td class="row1">{L_SIG_RESET}<br /><span class="gensmall">{L_SIG_RESET_EXPLAIN}</span></td>
	<td class="row2"><input type="button" name="sig_reset" value="{L_RESET}" class="liteoption" onClick="window.open('{U_SIG_RESET}', '_phpbbsig_reset', 'HEIGHT=155,resizable=no,WIDTH=350');return false;" /></td>
</tr>
<!-- End replacement - Signatures control MOD -->

# 
#-----[ OPEN ]------------------------------------------------ 
# 
templates/subSilver/admin/user_edit_body.tpl

# 
#-----[ FIND ]------------------------------------------------ 
# 
# NOTE: esta es una bsqueda por partes de lineas de cdigo!
# Las lineas originales a buscar son mas largas y deberian verse as (si es que ningun mod no las ha modificado ya):
#
# <tr> 
# 	  <td class="row1"><span class="gen">{L_ALLOW_AVATAR}</span></td>
#
<tr> 
{L_ALLOW_AVATAR}

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

<!-- Start add - Signatures control MOD -->
<tr> 
  <td class="row1"><span class="gen">{L_SIG_ALLOW_SIGNATURE}</span></td>
  <td class="row2"> 
	<input type="radio" name="user_allowsignature" value="2" {ALLOW_SIGNATURE_YES_NOT_CONTROLED} />
	<span class="gen">{L_SIG_YES_NOT_CONTROLED}</span>&nbsp;
	<input type="radio" name="user_allowsignature" value="1" {ALLOW_SIGNATURE_YES_CONTROLED} />
	<span class="gen">{L_SIG_YES_CONTROLED}</span>&nbsp;
	<input type="radio" name="user_allowsignature" value="0" {ALLOW_SIGNATURE_NO} />
	<span class="gen">{L_NO}</span></td>
</tr>
<!-- End replacement - Signatures control MOD -->

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