diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-30 14:24:13 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-04-30 14:24:13 +0000 |
commit | 0dec4135c54085caf9fd31f40ad4ff1fe94ba071 (patch) | |
tree | 8c4949c654d6d244f59d98a76b456fe334205581 /phpBB/includes/functions_profile_fields.php | |
parent | 7eee98f316bc587fe7e73eaf5aa0aff3e1809ffb (diff) | |
download | forums-0dec4135c54085caf9fd31f40ad4ff1fe94ba071.tar forums-0dec4135c54085caf9fd31f40ad4ff1fe94ba071.tar.gz forums-0dec4135c54085caf9fd31f40ad4ff1fe94ba071.tar.bz2 forums-0dec4135c54085caf9fd31f40ad4ff1fe94ba071.tar.xz forums-0dec4135c54085caf9fd31f40ad4ff1fe94ba071.zip |
- test slightly modified topic tracking code
- some bugfixes
git-svn-id: file:///svn/phpbb/trunk@5135 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_profile_fields.php')
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index f0d44dd1c1..12a4acd530 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -18,18 +18,21 @@ class custom_profile var $profile_cache = array(); var $options_lang = array(); - // Build language options cache, useful for viewtopic display + /** + * Build profile cache, used for display + */ function build_cache() { - global $db, $user; + 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 WHERE l.lang_id = ' . $user->get_iso_lang_id() . ' - AND f.field_active = 1 - AND f.field_hide = 0 + AND f.field_active = 1 ' . + ((!$auth->acl_gets('a_', 'm_')) ? ' AND f.field_hide = 0 AND f.field_no_view = 0 ' : '') . ' AND l.field_id = f.field_id GROUP BY f.field_id ORDER BY f.field_order'; @@ -42,7 +45,9 @@ class custom_profile $db->sql_freeresult($result); } - // Get language entries for options and store them here for later use + /** + * Get language entries for options and store them here for later use + */ function get_option_lang($field_id, $lang_id, $field_type, $preview) { global $db; @@ -74,7 +79,9 @@ class custom_profile } } - // Functions performing operations on register/profile/profile admin + /** + * Submit profile field + */ function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error) { global $auth, $db, $user; @@ -152,8 +159,9 @@ class custom_profile $db->sql_freeresult($result); } - // Assign fields to template, mode can be profile (for profile change) or register (for registration) - // function generate_profile_fields($mode, $lang_id, $cp_error) + /** + * Assign fields to template, mode can be profile (for profile change) or register (for registration) + */ function generate_profile_fields($mode, $lang_id) { global $db, $template, $auth; @@ -181,8 +189,10 @@ class custom_profile $db->sql_freeresult($result); } - // Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled) - // This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template + /** + * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled) + * This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template + */ function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false) { global $db; @@ -243,9 +253,10 @@ class custom_profile { // $profile_row == $user_fields[$row['user_id']]; $tpl_fields = array(); + $tpl_fields['row'] = $tpl_fields['blockrow'] = array(); foreach ($profile_row as $ident => $ident_ary) { - $tpl_fields += array( + $tpl_fields['row'] += array( 'PROFILE_' . strtoupper($ident) . '_VALUE' => $this->get_profile_value($ident_ary), 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'], 'PROFILE_' . strtoupper($ident) . '_NAME' => $ident_ary['data']['lang_name'], @@ -253,13 +264,21 @@ class custom_profile 'S_PROFILE_' . strtoupper($ident) => true ); + + $tpl_fields['blockrow'][] = array( + 'PROFILE_FIELD_VALUE' => $this->get_profile_value($ident_ary), + 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'], + 'PROFILE_FIELD_NAME' => $ident_ary['data']['lang_name'], + 'PROFILE_FIELD_EXPLAIN' => $ident_ary['data']['lang_explain'], + + 'S_PROFILE_' . strtoupper($ident) => true + ); } return $tpl_fields; } } - // VALIDATE Function - validate entered data function validate_profile_field($field_type, &$field_value, $field_data) { @@ -870,4 +889,4 @@ class custom_profile_admin extends custom_profile } } -?> +?>
\ No newline at end of file |