Changeset 2984
- Timestamp:
- 05/03/2010 11:28:51 PM (15 years ago)
- Location:
- branches/1.2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-avatars.php
r2957 r2984 109 109 $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"'; 110 110 111 $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', str_replace( WP_CONTENT_DIR, BP_AVATAR_URL, BP_AVATAR_UPLOAD_PATH ). '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );111 $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', BP_AVATAR_URL . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 112 112 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 113 113 … … 294 294 /* We only want to handle one image after resize. */ 295 295 if ( empty( $bp->avatar_admin->resized ) ) 296 $bp->avatar_admin->image->dir = $bp->avatar_admin->original['file'];296 $bp->avatar_admin->image->dir = str_replace( BP_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->original['file'] ); 297 297 else { 298 $bp->avatar_admin->image->dir = $bp->avatar_admin->resized;298 $bp->avatar_admin->image->dir = str_replace( BP_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->resized ); 299 299 @unlink( $bp->avatar_admin->original['file'] ); 300 300 } 301 301 302 302 /* Set the url value for the image */ 303 $bp->avatar_admin->image->url = str_replace( WP_CONTENT_DIR, BP_AVATAR_URL, $bp->avatar_admin->image->dir );303 $bp->avatar_admin->image->url = BP_AVATAR_URL . $bp->avatar_admin->image->dir; 304 304 305 305 return true; … … 334 334 return false; 335 335 336 if ( !file_exists( WP_CONTENT_DIR . '/' . $original_file ) ) 336 $original_file = BP_AVATAR_UPLOAD_PATH . $original_file; 337 338 if ( !file_exists( $original_file ) ) 337 339 return false; 338 340 339 341 if ( !$item_id ) 340 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR .dirname( $original_file ), $item_id, $object, $avatar_dir );342 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir ); 341 343 else 342 344 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); … … 363 365 364 366 /* Crop the image */ 365 $full_cropped = wp_crop_image( WP_CONTENT_DIR .$original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_FULL_WIDTH, BP_AVATAR_FULL_HEIGHT, false, $avatar_folder_dir . '/' . $full_filename );366 $thumb_cropped = wp_crop_image( WP_CONTENT_DIR .$original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_THUMB_WIDTH, BP_AVATAR_THUMB_HEIGHT, false, $avatar_folder_dir . '/' . $thumb_filename );367 $full_cropped = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_FULL_WIDTH, BP_AVATAR_FULL_HEIGHT, false, $avatar_folder_dir . '/' . $full_filename ); 368 $thumb_cropped = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, BP_AVATAR_THUMB_WIDTH, BP_AVATAR_THUMB_HEIGHT, false, $avatar_folder_dir . '/' . $thumb_filename ); 367 369 368 370 /* Remove the original */ 369 @unlink( WP_CONTENT_DIR .$original_file );371 @unlink( $original_file ); 370 372 371 373 return true; … … 414 416 415 417 function bp_core_avatar_upload_path() { 416 if ( bp_core_is_multisite() ) 417 $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' ); 418 else { 419 if ( !$path = get_option( 'upload_path' ) ) 420 $path = WP_CONTENT_DIR . '/uploads'; 421 else 422 $path = ABSPATH . $path; 423 } 424 425 return apply_filters( 'bp_core_avatar_upload_path', $path ); 418 $upload_dir = wp_upload_dir(); 419 return apply_filters( 'bp_core_avatar_upload_path', $upload_dir['basedir'] ); 426 420 } 427 421 428 422 function bp_core_avatar_url() { 429 if ( !bp_core_is_multisite() ) 430 return WP_CONTENT_URL; 431 432 return apply_filters( 'bp_core_avatar_url', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) ); 423 $upload_dir = wp_upload_dir(); 424 return apply_filters( 'bp_core_avatar_url', $upload_dir['baseurl'] ); 433 425 } 434 426 -
branches/1.2/bp-core/bp-core-cssjs.php
r2938 r2984 79 79 global $bp; 80 80 81 $image = apply_filters( 'bp_inline_cropper_image', getimagesize( $bp->avatar_admin->image->dir ) );81 $image = apply_filters( 'bp_inline_cropper_image', getimagesize( BP_AVATAR_UPLOAD_PATH . $bp->avatar_admin->image->dir ) ); 82 82 $aspect_ratio = 1; 83 83 -
branches/1.2/bp-core/bp-core-signup.php
r2934 r2984 520 520 @wp_mkdir_p( $path ); 521 521 522 $newurl = str_replace( BP_AVATAR_UPLOAD_PATH, BP_AVATAR_URL, $path );522 $newurl = BP_AVATAR_URL . '/avatars/signups/' . $bp->signup->avatar_dir; 523 523 $newburl = $newurl; 524 524 $newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir; -
branches/1.2/bp-groups.php
r2973 r2984 1860 1860 @wp_mkdir_p( $path ); 1861 1861 1862 $newurl = str_replace( BP_AVATAR_UPLOAD_PATH, BP_AVATAR_URL, $path );1862 $newurl = BP_AVATAR_URL . '/group-avatars/' . $group_id; 1863 1863 $newburl = $newurl; 1864 1864 $newsubdir = '/group-avatars/' . $group_id; -
branches/1.2/bp-xprofile.php
r2982 r2984 876 876 @wp_mkdir_p( $path ); 877 877 878 $newurl = str_replace( BP_AVATAR_UPLOAD_PATH, BP_AVATAR_URL, $path );878 $newurl = BP_AVATAR_URL . '/avatars/' . $user_id; 879 879 $newburl = $newurl; 880 880 $newsubdir = '/avatars/' . $user_id;
Note: See TracChangeset
for help on using the changeset viewer.