phpBB

Code Changes

File: includes/acp/acp_profile.php

  Unmodified   Added   Modified   Removed
Line 365Line 365
					$field_row = array_merge($default_values[$field_type], array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,

					$field_row = array_merge($default_values[$field_type], array(
'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
'field_required' => 0,

 
						'field_show_novalue'=> 0,

						'field_hide'		=> 0,
'field_show_profile'=> 0,
'field_no_view' => 0,

						'field_hide'		=> 0,
'field_show_profile'=> 0,
'field_no_view' => 0,

Line 380Line 381

// $exclude contains the data we gather in each step
$exclude = array(


// $exclude contains the data we gather in each step
$exclude = array(

					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),

					1	=> array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'),

					2	=> array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);

					2	=> array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);

Line 405Line 406
				// Visibility Options...
$visibility_ary = array(
'field_required',

				// Visibility Options...
$visibility_ary = array(
'field_required',

 
					'field_show_novalue',

					'field_show_on_reg',
'field_show_on_vt',
'field_show_profile',

					'field_show_on_reg',
'field_show_on_vt',
'field_show_profile',

Line 504Line 506
							}
}
}

							}
}
}

					/* else if ($field_type == FIELD_BOOL && $key == 'field_default_value')

					else if ($field_type == FIELD_BOOL && $key == 'field_default_value')

					{

					{

						// Get the number of options if this key is 'field_maxlen'
$var = request_var('field_default_value', 0);
}*/
























						// 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only.
// 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only.
// If we switch the type on step 2, we have to adjust field value.
// 1 is a common value for the checkbox and radio buttons.

// Adjust unchecked checkbox value.
// If we return or save settings from 2nd/3rd page
// and the checkbox is unchecked, set the value to 0.
if (isset($_REQUEST['step']) && !isset($_REQUEST[$key]))
{
$var = 0;
}

// If we switch to the checkbox type but former radio buttons value was 2,
// which is not the case for the checkbox, set it to 0 (unchecked).
if ($cp->vars['field_length'] == 2 && $var == 2)
{
$var = 0;
}
// If we switch to the radio buttons but the former checkbox value was 0,
// which is not the case for the radio buttons, set it to 0.
else if ($cp->vars['field_length'] == 1 && $var == 0)
{
$var = 2;
}
}

					else if ($field_type == FIELD_INT && $key == 'field_default_value')
{
// Permit an empty string

					else if ($field_type == FIELD_INT && $key == 'field_default_value')
{
// Permit an empty string

						if (request_var('field_default_value', '') === '')

						if ($action == 'create' && request_var('field_default_value', '') === '')

						{
$var = '';
}

						{
$var = '';
}

Line 675Line 700
						else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
{
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));

						else if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options']))
{
$_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true));

 
						}
else if ($field_type == FIELD_BOOL && $key == 'field_default_value')
{
$_new_key_ary[$key] = request_var($key, $cp->vars[$key]);

						}
else
{

						}
else
{

Line 730Line 759
						$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,

						$template->assign_vars(array(
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,

 
							'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false,

							'S_SHOW_ON_REG'		=> ($cp->vars['field_show_on_reg']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,

							'S_SHOW_ON_REG'		=> ($cp->vars['field_show_on_reg']) ? true : false,
'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,

Line 1046Line 1076
			'field_default_value'	=> $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],

			'field_default_value'	=> $cp->vars['field_default_value'],
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],

 
			'field_show_novalue'	=> $cp->vars['field_show_novalue'],

			'field_show_on_reg'		=> $cp->vars['field_show_on_reg'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
'field_hide' => $cp->vars['field_hide'],

			'field_show_on_reg'		=> $cp->vars['field_show_on_reg'],
'field_show_on_vt' => $cp->vars['field_show_on_vt'],
'field_hide' => $cp->vars['field_hide'],

Line 1480Line 1511

case 'mssql':
case 'mssql_odbc':


case 'mssql':
case 'mssql_odbc':

 
			case 'mssqlnative':


// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";


// We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
$sql = 'ALTER TABLE [' . PROFILE_FIELDS_DATA_TABLE . "] ADD [$field_ident] ";