Index: branches/5.2.x/core/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r15137 -r16290 --- branches/5.2.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 15137) +++ branches/5.2.x/core/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 16290) @@ -1,6 +1,6 @@ SelectParam($params, 'name,field'); $profile_mapping = $this->Application->getUnitOption('u', 'UserProfileMapping'); $user_field = array_key_exists($field, $profile_mapping) ? $profile_mapping[$field] : false; - if (array_key_exists('profile_field', $params) && $params['profile_field']) { - // get variable from mapping - $params['name'] = $user_field; - $value = $this->Application->ProcessParsedTag('u.profile', 'Field', $params); + // Get field value to show on "Public Profile" page. + if ( array_key_exists('profile_field', $params) && $params['profile_field'] ) { + if ( $user_field ) { + $params['name'] = $user_field; + } + + return $this->Application->ProcessParsedTag('u.profile', 'Field', $params); } - elseif ($user_field) { - // old style variable for displaying fields in public profile (named "pp_*") - $block_params = Array ('name' => 'DisplayToPublic', 'value' => $user_field); - $value = $this->Application->ProcessParsedTag($this->getUserPrefixSpecial(), 'Selected', $block_params); + + if ( $user_field ) { + // Determine if field should be shown on "Public Profile" page. + $block_params = array('name' => 'DisplayToPublic', 'value' => $user_field); + $selected = $this->Application->ProcessParsedTag( + $this->getUserPrefixSpecial(), + 'Selected', + $block_params + ); } else { - // get variable by name - $value = $this->recallUserProfileVar($field); + // New user-defined public profile field - fallback to persistent session storage. + $selected = $this->recallUserProfileVar($field) == 1; } - if (isset($params['checked']) && $params['checked']) { - $checked_value = isset($params['value']) ? $params['value'] : 1; - $value = ($value == $checked_value) ? 'checked' : ''; + if ( isset($params['checked']) && $params['checked'] ) { + return $selected ? 'checked' : ''; } - return $value; + return $selected ? 1 : 0; } /** @@ -142,4 +156,4 @@ return parent::prepareInputName($params); } - } \ No newline at end of file + }