diff options
Diffstat (limited to 'phpBB/includes/functions_profile_fields.php')
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index b621095df4..cc59648e54 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -40,14 +40,14 @@ class custom_profile { case 'register': // If the field is required we show it on the registration page and do not show hidden fields - $sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0'; break; case 'profile': // Show hidden fields to moderators/admins if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { - $sql_where .= ' AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_profile = 1'; } break; @@ -106,7 +106,7 @@ class custom_profile { case FIELD_DATE: $field_validate = explode('-', $field_value); - + $day = (isset($field_validate[0])) ? (int) $field_validate[0] : 0; $month = (isset($field_validate[1])) ? (int) $field_validate[1] : 0; $year = (isset($field_validate[2])) ? (int) $field_validate[2] : 0; @@ -154,14 +154,14 @@ class custom_profile return 'FIELD_TOO_LARGE'; } break; - + case FIELD_DROPDOWN: if ($field_value == $field_data['field_novalue'] && $field_data['field_required']) { return 'FIELD_REQUIRED'; } break; - + case FIELD_STRING: case FIELD_TEXT: if (empty($field_value) && !$field_data['field_required']) @@ -205,7 +205,7 @@ class custom_profile global $db, $user, $auth; $this->profile_cache = array(); - + // Display hidden/no_view fields for admin/moderator $sql = 'SELECT l.*, f.* FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f @@ -234,7 +234,7 @@ class custom_profile if ($preview) { $lang_options = (!is_array($this->vars['lang_options'])) ? explode("\n", $this->vars['lang_options']) : $this->vars['lang_options']; - + foreach ($lang_options as $num => $var) { $this->options_lang[$field_id][$lang_id][($num + 1)] = $var; @@ -271,14 +271,14 @@ class custom_profile { case 'register': // If the field is required we show it on the registration page and do not show hidden fields - $sql_where .= ' AND (f.field_show_on_reg = 1 OR f.field_required = 1) AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0'; break; case 'profile': // Show hidden fields to moderators/admins if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { - $sql_where .= ' AND f.field_hide = 0'; + $sql_where .= ' AND f.field_show_profile = 1'; } break; @@ -316,12 +316,12 @@ class custom_profile case 'FIELD_TOO_SMALL': $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_minlen']); break; - + case 'FIELD_TOO_LONG': case 'FIELD_TOO_LARGE': $error = sprintf($user->lang[$cp_result], $row['lang_name'], $row['field_maxlen']); break; - + case 'FIELD_INVALID_CHARS': switch ($row['field_validation']) { @@ -339,7 +339,7 @@ class custom_profile } break; } - + if ($error != '') { $cp_error[] = $error; @@ -434,7 +434,7 @@ class custom_profile 'S_PROFILE_' . strtoupper($ident) => true ); } - + return $tpl_fields; } else @@ -589,7 +589,7 @@ class custom_profile else { $value = (isset($_REQUEST[$profile_row['field_ident']])) ? request_var($profile_row['field_ident'], $default_value, true) : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); - + if (gettype($value) == 'string') { $value = utf8_normalize_nfc($value); @@ -672,7 +672,7 @@ class custom_profile $profile_row['s_year_options'] .= '<option value="' . $i . '"' . (($i == $year) ? ' selected="selected"' : '') . ">$i</option>"; } unset($now); - + $profile_row['field_value'] = 0; $template->assign_block_vars($this->profile_types[$profile_row['field_type']], array_change_key_case($profile_row, CASE_UPPER)); } @@ -826,7 +826,7 @@ class custom_profile $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); - + return $cp_data; } @@ -838,9 +838,9 @@ class custom_profile { global $phpbb_root_path, $phpEx; global $config; - + $var_name = 'pf_' . $profile_row['field_ident']; - + switch ($profile_row['field_type']) { case FIELD_DATE: @@ -860,7 +860,7 @@ class custom_profile $month = request_var($var_name . '_month', 0); $year = request_var($var_name . '_year', 0); } - + $var = sprintf('%2d-%2d-%4d', $day, $month, $year); break; @@ -931,7 +931,7 @@ class custom_profile_admin extends custom_profile return $validate_options; } - + /** * Get string options for second step in ACP */ @@ -1086,4 +1086,4 @@ class custom_profile_admin extends custom_profile } } -?>
\ No newline at end of file +?> |