1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00
git-svn-id: file:///svn/phpbb/trunk@6449 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-10-06 22:27:17 +00:00
parent 7777bd5f50
commit 6c49652a19
2 changed files with 12 additions and 12 deletions

View File

@ -135,7 +135,7 @@ class acp_profile
foreach ($old_table_cols as $declaration)
{
$entities = preg_split('#\s+#', trim($declaration));
if ($entities[0] !== '_' . $field_ident)
if ($entities[0] !== 'pf_' . $field_ident)
{
$column_list[] = $entities[0];
}
@ -143,7 +143,7 @@ class acp_profile
$columns = implode(',', $column_list);
$new_table_cols = preg_replace('/' . '_' . $field_ident . '[^,]+,/', '', $new_table_cols);
$new_table_cols = preg_replace('/' . 'pf_' . $field_ident . '[^,]+,/', '', $new_table_cols);
// create a new table and fill it up. destroy the temp one
$db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');');
@ -154,7 +154,7 @@ class acp_profile
break;
default:
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP _$field_ident");
$db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP pf_$field_ident");
}
$order = 0;
@ -968,7 +968,7 @@ class acp_profile
if ($action == 'create')
{
$field_ident = '_' . $field_ident;
$field_ident = 'pf_' . $field_ident;
$profile_sql[] = $this->add_field_ident($field_ident, $field_type);
}
@ -1176,7 +1176,7 @@ class acp_profile
}
else
{
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 1) . ':' . $cp->vars['lang_name']);
add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 3) . ':' . $cp->vars['lang_name']);
trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
}

View File

@ -286,8 +286,8 @@ class custom_profile
while ($row = $db->sql_fetchrow($result))
{
$cp_data['_' . $row['field_ident']] = $this->get_profile_field($row);
$check_value = $cp_data['_' . $row['field_ident']];
$cp_data['pf_' . $row['field_ident']] = $this->get_profile_field($row);
$check_value = $cp_data['pf_' . $row['field_ident']];
if (($cp_result = $this->validate_profile_field($row['field_type'], $check_value, $row)) !== false)
{
@ -382,7 +382,7 @@ class custom_profile
{
foreach ($field_data as $user_id => $row)
{
$user_fields[$user_id][$used_ident]['value'] = $row['_' . $used_ident];
$user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident];
$user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident];
}
}
@ -542,7 +542,7 @@ class custom_profile
global $user;
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']);
$user_ident = 'pf_' . str_replace('pf_', '', $profile_row['field_ident']);
// checkbox - only testing for isset
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
@ -609,7 +609,7 @@ class custom_profile
global $user, $template;
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
$user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']);
$user_ident = 'pf_' . str_replace('pf_', '', $profile_row['field_ident']);
$now = getdate();
@ -787,7 +787,7 @@ class custom_profile
$sql_not_in = array();
foreach ($cp_data as $key => $null)
{
$sql_not_in[] = (strncmp($key, '_', 1) === 0) ? substr($key, 1) : $key;
$sql_not_in[] = (strncmp($key, 'pf_', 3) === 0) ? substr($key, 3) : $key;
}
$sql = 'SELECT f.field_type, f.field_ident, f.field_default_value, l.lang_default_value
@ -805,7 +805,7 @@ class custom_profile
$row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
}
$cp_data['_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
$cp_data['pf_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
}
$db->sql_freeresult($result);