Changeset 2209 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 12/27/2009 10:41:10 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-avatars.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r2168 r2209 9 9 */ 10 10 11 if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) ) 12 define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() ); 13 11 14 if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) 12 15 define( 'BP_AVATAR_THUMB_WIDTH', 50 ); … … 24 27 define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 ); 25 28 26 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) 27 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 ); 29 if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) { 30 if ( !get_site_option( 'fileupload_maxk' ) ) 31 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); /* 5mb */ 32 else 33 define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', get_site_option( 'fileupload_maxk' ) * 1024 ); 34 } 28 35 29 36 if ( !defined( 'BP_AVATAR_DEFAULT' ) ) … … 95 102 $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"'; 96 103 97 $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', $bp->root_domain . '/' . basename( WP_CONTENT_DIR ) . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );98 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );104 $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, BP_AVATAR_UPLOAD_PATH ) . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 105 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 99 106 100 107 /**** … … 188 195 } 189 196 190 if ( 'user' == $object ) { 191 /* Delete any legacy meta entries if this is a user avatar */ 192 delete_usermeta( $item_id, 'bp_core_avatar_v1_path' ); 193 delete_usermeta( $item_id, 'bp_core_avatar_v1' ); 194 delete_usermeta( $item_id, 'bp_core_avatar_v2_path' ); 195 delete_usermeta( $item_id, 'bp_core_avatar_v2' ); 196 } 197 198 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 197 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 199 198 200 199 if ( !file_exists( $avatar_folder_dir ) ) … … 304 303 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . dirname( $original_file ), $item_id, $object, $avatar_dir ); 305 304 else 306 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );305 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); 307 306 308 307 if ( !file_exists( $avatar_folder_dir ) ) … … 368 367 } 369 368 369 function bp_core_avatar_upload_path() { 370 if ( bp_core_is_multiblog_install() ) 371 $path = ABSPATH . get_blog_option( BP_ROOT_BLOG, 'upload_path' ); 372 else 373 $path = get_option( 'upload_path' ); 374 375 return apply_filters( 'bp_core_avatar_upload_path', $path ); 376 } 377 370 378 ?>
Note: See TracChangeset
for help on using the changeset viewer.