public function displayValue($metaKey = '') { global $userMeta; $key = $metaKey; if (empty($metaKey) || !empty($this->id)) { $this->sanitizeField(); $key = !empty($this->data['field_name']) ? $this->data['field_name'] : $key; } if (empty($key)) { return; } $fieldValue = null; $user = $userMeta->determineUser(); if (!empty($user)) { if (isset($this->data['default_value'])) { $fieldValue = $userMeta->convertUserContent($user, $this->data['default_value']); } $key = trim($key); if (isset($user->{$key})) { $fieldValue = $user->{$key}; } if (is_array($fieldValue)) { $fieldValue = implode(', ', $fieldValue); } if (!empty($this->type) && in_array($this->type, array('user_avatar', 'file'))) { $field = $this->data; if (!empty($field)) { $field['field_value'] = $fieldValue; $field['read_only'] = true; } $umFile = new umFile($field); $fieldValue = $umFile->showFile(); } } return $fieldValue; }
function ajaxShowUploadedFile() { global $userMeta; $userMeta->verifyNonce(); if (isset($_REQUEST['showimage'])) { if (isset($_REQUEST['imageurl'])) { echo "<img src='{$_REQUEST['imageurl']}' />"; } die; } $file = new umFile(); $file->ajaxUpload(); die; /** * Commented since 1.1.7beta1 * // Showing Image $fieldID = trim( str_replace( 'um_field_', '', @$_REQUEST['field_id'] ) ); $fields = $userMeta->getData( 'fields' ); $field = @$fields[@$fieldID]; if ( @$field['field_type'] == 'user_avatar' ) { if ( ! empty( $field['image_size'] ) ) { $field['image_width'] = $field['image_size']; $field['image_height'] = $field['image_size']; } else { $field['image_width'] = 96; $field['image_height'] = 96; } } if ( ! empty( $field ) ) { echo $userMeta->renderPro( 'showFile', array( 'filepath' => @$_REQUEST['filepath'], 'field_name' => @$_REQUEST['field_name'], 'width' => @$field['image_width'], 'height' => @$field['image_height'], 'crop' => ! empty( $field['crop_image'] ) ? true : false, //'readonly' => @$fieldReadOnly, // implementation of read-only is not needed. ) ); } */ die; }
if (empty($field['hide_default_avatar'])) { $userAvatar = @$actionType == 'registration' ? get_avatar('nobody@noemail') : get_avatar($userID); } } /*if ( ! empty( $field[ 'field_value' ] ) ){ $size = ! empty( $field['image_size'] ) ? $field['image_size'] : 96; $userAvatar = get_avatar( $userID, $size ); } else { if ( empty( $field['hide_default_avatar'] ) ) $userAvatar = ( @$actionType == 'registration' ) ? get_avatar( 'nobody@noemail' ) : get_avatar( $userID ); }*/ } if ($userAvatar) { $fieldResultContent = $userAvatar; } else { $umFile = new umFile($field); $fieldResultContent = $umFile->showFile(); } /*$fieldResultContent = $userMeta->render( 'showFile', array( 'filepath' => $field['field_value'], 'field_name' => $field['field_name'], 'avatar' => $userAvatar, 'width' => @$field['image_width'], 'height' => @$field['image_height'], 'crop' => !empty( $field['crop_image'] ) ? true : false, 'readonly' => $fieldReadOnly, ) );*/ if (@$field['title_position'] == 'left') { $fieldResultContent = "<div class=\"um_left_margin\">{$fieldResultContent}</div>"; } $fieldResultDiv = true;