Changeset 436 for trunk/bp-xprofile/bp-xprofile-signup.php
- Timestamp:
- 10/24/2008 04:00:42 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-xprofile/bp-xprofile-signup.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-signup.php
r432 r436 152 152 2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(CORE_MAX_FILE_SIZE), 153 153 3 => __("The uploaded file was only partially uploaded", 'buddypress'), 154 4 => __("No file was uploaded", 'buddypress'),155 154 6 => __("Missing a temporary folder", 'buddypress') 156 155 ); 157 156 158 if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) { 159 $avatar_error = true; 160 $avatar_error_msg = $uploadErrors[$_FILES['file']['error']]; 161 } 162 163 if ( $checked_upload && !$checked_size = bp_core_check_avatar_size($_FILES) ) { 164 $avatar_error = true; 165 $avatar_size = size_format(CORE_MAX_FILE_SIZE); 166 $avatar_error_msg = sprintf( __('The file you uploaded is too big. Please upload a file under %s', 'buddypress'), $avatar_size); 167 } 168 169 if ( $checked_upload && $checked_size && !$checked_type = bp_core_check_avatar_type($_FILES) ) { 170 $avatar_error = true; 171 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.', 'buddypress'); 172 } 173 174 // "Handle" upload into temporary location 175 if ( $checked_upload && $checked_size && $checked_type && !$original = bp_core_handle_avatar_upload($_FILES) ) { 176 $avatar_error = true; 177 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.', 'buddypress'); 178 } 179 180 if ( $checked_upload && $checked_size && $checked_type && $original && !$checked_dims = bp_core_check_avatar_dimensions($original) ) { 181 $avatar_error = true; 182 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.', 'buddypress'), CORE_AVATAR_V2_W, CORE_AVATAR_V2_W ); 183 } 184 185 if ( $checked_upload && $checked_size && $checked_type && $original && $checked_dims && !$canvas = bp_core_resize_avatar($original) ) 186 $canvas = $original; 187 157 if ( $_FILES['file']['error'] !== 4 ) { 158 if ( !$checked_upload = bp_core_check_avatar_upload($_FILES) ) { 159 $avatar_error = true; 160 $avatar_error_msg = $uploadErrors[$_FILES['file']['error']]; 161 } 162 163 if ( $checked_upload && !$checked_size = bp_core_check_avatar_size($_FILES) ) { 164 $avatar_error = true; 165 $avatar_size = size_format(CORE_MAX_FILE_SIZE); 166 $avatar_error_msg = sprintf( __('The file you uploaded is too big. Please upload a file under %s', 'buddypress'), $avatar_size); 167 } 168 169 if ( $checked_upload && $checked_size && !$checked_type = bp_core_check_avatar_type($_FILES) ) { 170 $avatar_error = true; 171 $avatar_error_msg = __('Please upload only JPG, GIF or PNG photos.', 'buddypress'); 172 } 173 174 // "Handle" upload into temporary location 175 if ( $checked_upload && $checked_size && $checked_type && !$original = bp_core_handle_avatar_upload($_FILES) ) { 176 $avatar_error = true; 177 $avatar_error_msg = __('Upload Failed! Your photo dimensions are likely too big.', 'buddypress'); 178 } 179 180 if ( $checked_upload && $checked_size && $checked_type && $original && !$checked_dims = bp_core_check_avatar_dimensions($original) ) { 181 $avatar_error = true; 182 $avatar_error_msg = sprintf( __('The image you upload must have dimensions of %d x %d pixels or larger.', 'buddypress'), CORE_AVATAR_V2_W, CORE_AVATAR_V2_W ); 183 } 184 185 if ( $checked_upload && $checked_size && $checked_type && $original && $checked_dims && !$canvas = bp_core_resize_avatar($original) ) 186 $canvas = $original; 187 } 188 188 189 if ( !$has_errors && !$avatar_error ) { 189 190 $public = (int) $_POST['blog_public'];
Note:
See TracChangeset
for help on using the changeset viewer.