Skip to:
Content

BuddyPress.org

Changeset 4632


Ignore:
Timestamp:
07/09/2011 09:45:45 PM (15 years ago)
Author:
boonebgorges
Message:

Introduces wrapper functions for avatar-related constants. Also moves avatar settings into bp global so that they are more easily configurable. See #3314

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r4602 r4632  
    1212function bp_core_set_avatar_constants() {
    1313        global $bp;
    14 
    15         if ( !defined( 'BP_AVATAR_UPLOAD_PATH' ) )
    16                 define( 'BP_AVATAR_UPLOAD_PATH', bp_core_avatar_upload_path() );
    17 
    18         if ( !defined( 'BP_AVATAR_URL' ) )
    19                 define( 'BP_AVATAR_URL', bp_core_avatar_url() );
    20 
     14       
    2115        if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
    2216                define( 'BP_AVATAR_THUMB_WIDTH', 50 );
    … …  
    4842}
    4943add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 );
     44
     45function bp_core_set_avatar_globals() {
     46        global $bp;
     47       
     48        // Dimensions
     49        $bp->avatar->thumb->width          = BP_AVATAR_THUMB_WIDTH;
     50        $bp->avatar->thumb->height         = BP_AVATAR_THUMB_HEIGHT;
     51        $bp->avatar->full->width           = BP_AVATAR_FULL_WIDTH;
     52        $bp->avatar->full->height          = BP_AVATAR_FULL_HEIGHT;
     53       
     54        // Upload maximums
     55        $bp->avatar->original_max_width    = BP_AVATAR_ORIGINAL_MAX_WIDTH;
     56        $bp->avatar->original_max_filesize = BP_AVATAR_ORIGINAL_MAX_FILESIZE;
     57       
     58        // Defaults
     59        $bp->avatar->thumb->default        = BP_AVATAR_DEFAULT_THUMB;
     60        $bp->avatar->full->default         = BP_AVATAR_DEFAULT;
     61       
     62        // These have to be set on page load in order to avoid infinite filter loops at runtime
     63        $bp->avatar->upload_path           = bp_core_avatar_upload_path();
     64        $bp->avatar->url                   = bp_core_avatar_url();
     65       
     66        do_action( 'bp_core_set_avatar_globals' );
     67}
     68add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' );
    5069
    5170/**
    … …  
    149168                $html_width = " width='{$width}'";
    150169        else
    151                 $html_width = ( 'thumb' == $type ) ? ' width="' . BP_AVATAR_THUMB_WIDTH . '"' : ' width="' . BP_AVATAR_FULL_WIDTH . '"';
     170                $html_width = ( 'thumb' == $type ) ? ' width="' . bp_core_avatar_thumb_width() . '"' : ' width="' . bp_core_avatar_full_width() . '"';
    152171
    153172        // Set avatar height
    … …  
    155174                $html_height = " height='{$height}'";
    156175        else
    157                 $html_height = ( 'thumb' == $type ) ? ' height="' . BP_AVATAR_THUMB_HEIGHT . '"' : ' height="' . BP_AVATAR_FULL_HEIGHT . '"';
     176                $html_height = ( 'thumb' == $type ) ? ' height="' . bp_core_avatar_thumb_height() . '"' : ' height="' . bp_core_avatar_full_height() . '"';
    158177
    159178        // Set avatar URL and DIR based on prepopulated constants
    160         $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', BP_AVATAR_URL . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    161         $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     179        $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', bp_core_avatar_url() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     180        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    162181
    163182        /****
    … …  
    237256                        $grav_size = $width;
    238257                else if ( 'full' == $type )
    239                         $grav_size = BP_AVATAR_FULL_WIDTH;
     258                        $grav_size = bp_core_avatar_full_width();
    240259                else if ( 'thumb' == $type )
    241                         $grav_size = BP_AVATAR_THUMB_WIDTH;
     260                        $grav_size = bp_core_avatar_thumb_width();
    242261
    243262                // Set gravatar type
    … …  
    245264                        $default_grav = 'wavatar';
    246265                else if ( 'mystery' == $bp->grav_default->{$object} )
    247                         $default_grav = apply_filters( 'bp_core_mysteryman_src', BP_AVATAR_DEFAULT, $grav_size );
     266                        $default_grav = apply_filters( 'bp_core_mysteryman_src', bp_core_avatar_default(), $grav_size );
    248267                else
    249268                        $default_grav = $bp->grav_default->{$object};
    … …  
    329348        }
    330349
    331         $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     350        $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    332351
    333352        if ( !file_exists( $avatar_folder_dir ) )
    … …  
    378397        $uploadErrors = array(
    379398                0 => __("There is no error, the file uploaded with success", 'buddypress'),
    380                 1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
    381                 2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE),
     399                1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
     400                2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ),
    382401                3 => __("The uploaded file was only partially uploaded", 'buddypress'),
    383402                4 => __("No file was uploaded", 'buddypress'),
    … …  
    391410
    392411        if ( !bp_core_check_avatar_size( $file ) ) {
    393                 bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format(BP_AVATAR_ORIGINAL_MAX_FILESIZE) ), 'error' );
     412                bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' );
    394413                return false;
    395414        }
    … …  
    415434
    416435        // Check image size and shrink if too large
    417         if ( $size[0] > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {
    418                 $thumb = wp_create_thumbnail( $bp->avatar_admin->original['file'], BP_AVATAR_ORIGINAL_MAX_WIDTH );
     436        if ( $size[0] > bp_core_avatar_original_max_width() ) {
     437                $thumb = wp_create_thumbnail( $bp->avatar_admin->original['file'], bp_core_avatar_original_max_width() );
    419438
    420439                // Check for thumbnail creation errors
    … …  
    430449        // We only want to handle one image after resize.
    431450        if ( empty( $bp->avatar_admin->resized ) )
    432                 $bp->avatar_admin->image->dir = str_replace( BP_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->original['file'] );
     451                $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] );
    433452        else {
    434                 $bp->avatar_admin->image->dir = str_replace( BP_AVATAR_UPLOAD_PATH, '', $bp->avatar_admin->resized );
     453                $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized );
    435454                @unlink( $bp->avatar_admin->original['file'] );
    436455        }
    … …  
    443462
    444463        // Set the url value for the image
    445         $bp->avatar_admin->image->url = BP_AVATAR_URL . $bp->avatar_admin->image->dir;
     464        $bp->avatar_admin->image->url = bp_core_avatar_url() . $bp->avatar_admin->image->dir;
    446465
    447466        return true;
    … …  
    473492                'item_id'       => false,
    474493                'original_file' => false,
    475                 'crop_w'        => BP_AVATAR_FULL_WIDTH,
    476                 'crop_h'        => BP_AVATAR_FULL_HEIGHT,
     494                'crop_w'        => bp_core_avatar_full_width(),
     495                'crop_h'        => bp_core_avatar_full_height(),
    477496                'crop_x'        => 0,
    478497                'crop_y'        => 0
    … …  
    493512                return false;
    494513
    495         $original_file = BP_AVATAR_UPLOAD_PATH . $original_file;
     514        $original_file = bp_core_avatar_upload_path() . $original_file;
    496515
    497516        if ( !file_exists( $original_file ) )
    … …  
    501520                $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
    502521        else
    503                 $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', BP_AVATAR_UPLOAD_PATH . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
     522                $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
    504523
    505524        if ( !file_exists( $avatar_folder_dir ) )
    … …  
    524543
    525544        // Crop the image
    526         $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 );
    527         $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 );
     545        $full_cropped  = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
     546        $thumb_cropped = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
    528547
    529548        // Remove the original
    … …  
    601620 */
    602621function bp_core_check_avatar_size( $file ) {
    603         if ( $file['file']['size'] > BP_AVATAR_ORIGINAL_MAX_FILESIZE )
     622        if ( $file['file']['size'] > bp_core_avatar_original_max_filesize() )
    604623                return false;
    605624
    … …  
    631650 */
    632651function bp_core_avatar_upload_path() {
    633         // Get upload directory information from current site
    634         $upload_dir = wp_upload_dir();
    635 
    636         // Directory does not exist and cannot be created
    637         if ( !empty( $upload_dir['error'] ) ) {
    638                 $basedir = '';
    639 
     652        global $bp;
     653       
     654        // See if the value has already been calculated and stashed in the $bp global
     655        if ( isset( $bp->avatar->upload_path ) ) {
     656                $basedir = $bp->avatar->upload_path;
    640657        } else {
    641                 $basedir = $upload_dir['basedir'];
    642 
    643                 // If multisite, and current blog does not match root blog, make adjustments
    644                 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
    645                         $basedir = get_blog_option( bp_get_root_blog_id(), 'upload_path' );
    646         }
    647 
     658                // If this value has been set in a constant, just use that
     659                if ( defined( 'BP_AVATAR_UPLOAD_PATH' ) ) {
     660                        $basedir = BP_AVATAR_UPLOAD_PATH;
     661                } else {
     662                        // Get upload directory information from current site
     663                        $upload_dir = wp_upload_dir();
     664               
     665                        // Directory does not exist and cannot be created
     666                        if ( !empty( $upload_dir['error'] ) ) {
     667                                $basedir = '';
     668               
     669                        } else {
     670                                $basedir = $upload_dir['basedir'];
     671               
     672                                // If multisite, and current blog does not match root blog, make adjustments
     673                                if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
     674                                        $basedir = get_blog_option( bp_get_root_blog_id(), 'upload_path' );
     675                        }
     676                }
     677               
     678                // Stash in $bp for later use
     679                $bp->avatar->upload_path = $basedir;
     680        }
     681       
    648682        return apply_filters( 'bp_core_avatar_upload_path', $basedir );
    649683}
    … …  
    658692 */
    659693function bp_core_avatar_url() {
    660         // Get upload directory information from current site
    661         $upload_dir = wp_upload_dir();
    662 
    663         // Directory does not exist and cannot be created
    664         if ( !empty( $upload_dir['error'] ) ) {
    665                 $baseurl = '';
    666 
     694        global $bp;
     695       
     696        // See if the value has already been calculated and stashed in the $bp global
     697        if ( isset( $bp->avatar->url ) ) {
     698                $baseurl = $bp->avatar->url;
    667699        } else {
    668                 $baseurl = $upload_dir['baseurl'];
    669 
    670                 // If multisite, and current blog does not match root blog, make adjustments
    671                 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
    672                         $baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' );
     700                // If this value has been set in a constant, just use that
     701                if ( defined( 'BP_AVATAR_URL' ) ) {
     702                        $baseurl = BP_AVATAR_URL;
     703                } else {
     704                        // Get upload directory information from current site
     705                        $upload_dir = wp_upload_dir();
     706               
     707                        // Directory does not exist and cannot be created
     708                        if ( !empty( $upload_dir['error'] ) ) {
     709                                $baseurl = '';
     710               
     711                        } else {
     712                                $baseurl = $upload_dir['baseurl'];
     713               
     714                                // If multisite, and current blog does not match root blog, make adjustments
     715                                if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
     716                                        $baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' );
     717                        }
     718                }
     719               
     720                // Stash in $bp for later use
     721                $bp->avatar->url = $baseurl;
    673722        }
    674723
    675724        return apply_filters( 'bp_core_avatar_url', $baseurl );
    676725}
     726
     727/**
     728 * Utility function for fetching an avatar dimension setting
     729 *
     730 * @package BuddyPress
     731 * @since 1.3
     732 *
     733 * @param str $type 'thumb' for thumbs, otherwise full
     734 * @param str $h_or_w 'height' for height, otherwise width
     735 * @return int $dim The dimension
     736 */
     737function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
     738        global $bp;
     739       
     740        $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int)$bp->avatar->{$type}->{$h_or_w} : false;
     741       
     742        return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
     743}
     744
     745/**
     746 * Get the avatar thumb width setting
     747 *
     748 * @package BuddyPress
     749 * @since 1.3
     750 *
     751 * @return int The thumb width
     752 */
     753function bp_core_avatar_thumb_width() {
     754        return apply_filters( 'bp_core_avatar_thumb_width', bp_core_avatar_dimension( 'thumb', 'width' ) );
     755}
     756
     757/**
     758 * Get the avatar thumb height setting
     759 *
     760 * @package BuddyPress
     761 * @since 1.3
     762 *
     763 * @return int The thumb height
     764 */
     765function bp_core_avatar_thumb_height() {
     766        return apply_filters( 'bp_core_avatar_thumb_height', bp_core_avatar_dimension( 'thumb', 'height' ) );
     767}
     768
     769/**
     770 * Get the avatar full width setting
     771 *
     772 * @package BuddyPress
     773 * @since 1.3
     774 *
     775 * @return int The full width
     776 */
     777function bp_core_avatar_full_width() {
     778        return apply_filters( 'bp_core_avatar_full_width', bp_core_avatar_dimension( 'full', 'width' ) );
     779}
     780
     781/**
     782 * Get the avatar full height setting
     783 *
     784 * @package BuddyPress
     785 * @since 1.3
     786 *
     787 * @return int The full height
     788 */
     789function bp_core_avatar_full_height() {
     790        return apply_filters( 'bp_core_avatar_full_height', bp_core_avatar_dimension( 'full', 'height' ) );
     791}
     792
     793/**
     794 * Get the max width for original avatar uploads
     795 *
     796 * @package BuddyPress
     797 * @since 1.3
     798 *
     799 * @return int The width
     800 */
     801function bp_core_avatar_original_max_width() {
     802        global $bp;
     803       
     804        return apply_filters( 'bp_core_avatar_original_max_width', (int)$bp->avatar->original_max_width );
     805}
     806
     807/**
     808 * Get the max filesize for original avatar uploads
     809 *
     810 * @package BuddyPress
     811 * @since 1.3
     812 *
     813 * @return int The filesize
     814 */
     815function bp_core_avatar_original_max_filesize() {
     816        global $bp;
     817       
     818        return apply_filters( 'bp_core_avatar_original_max_filesize', (int)$bp->avatar->original_max_filesize );
     819}
     820
     821/**
     822 * Get the default avatar
     823 *
     824 * @package BuddyPress
     825 * @since 1.3
     826 *
     827 * @return int The URL of the default avatar
     828 */
     829function bp_core_avatar_default() {
     830        global $bp;
     831       
     832        return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default );
     833}
     834
     835/**
     836 * Get the default avatar thumb
     837 *
     838 * @package BuddyPress
     839 * @since 1.3
     840 *
     841 * @return int The URL of the default avatar thumb
     842 */
     843function bp_core_avatar_default_thumb() {
     844        global $bp;
     845       
     846        return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default );
     847}
     848
     849
    677850?>
  • trunk/bp-core/bp-core-cssjs.php

    r4602 r4632  
    7373        global $bp;
    7474
    75         $image = apply_filters( 'bp_inline_cropper_image', getimagesize( BP_AVATAR_UPLOAD_PATH . $bp->avatar_admin->image->dir ) );
     75        $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) );
    7676        $aspect_ratio = 1;
    7777       
    78         $full_height = (int) constant( 'BP_AVATAR_FULL_HEIGHT' );
    79         $full_width  = (int) constant( 'BP_AVATAR_FULL_WIDTH'  );
    80 
     78        $full_height = bp_core_avatar_full_height();
     79        $full_width  = bp_core_avatar_full_width();
     80       
    8181        // Calculate Aspect Ratio
    8282        if ( $full_height && ( $full_width != $full_height ) )
    … …  
    146146                .custom .jcrop-vline, .custom .jcrop-hline { background: yellow; }
    147147                .custom .jcrop-handle { border-color: black; background-color: #C7BB00; -moz-border-radius: 3px; -webkit-border-radius: 3px; }
    148                 #avatar-crop-pane { width: <?php echo BP_AVATAR_FULL_WIDTH ?>px; height: <?php echo BP_AVATAR_FULL_HEIGHT ?>px; overflow: hidden; }
     148                #avatar-crop-pane { width: <?php echo bp_core_avatar_full_width() ?>px; height: <?php echo bp_core_avatar_full_height() ?>px; overflow: hidden; }
    149149                #avatar-crop-submit { margin: 20px 0; }
    150150                #avatar-upload-form img, #create-group-form img, #group-settings-form img { border: none !important; }
  • trunk/bp-groups/bp-groups-functions.php

    r4611 r4632  
    424424                $group_id = $bp->groups->current_group->id;
    425425
    426         $path    = BP_AVATAR_UPLOAD_PATH . '/group-avatars/' . $group_id;
     426        $path    = bp_core_avatar_upload_path() . '/group-avatars/' . $group_id;
    427427        $newbdir = $path;
    428428
    … …  
    430430                @wp_mkdir_p( $path );
    431431
    432         $newurl    = BP_AVATAR_URL . '/group-avatars/' . $group_id;
     432        $newurl    = bp_core_avatar_url() . '/group-avatars/' . $group_id;
    433433        $newburl   = $newurl;
    434434        $newsubdir = '/group-avatars/' . $group_id;
  • trunk/bp-members/bp-members-signup.php

    r4606 r4632  
    191191                // Check if the avatar folder exists. If it does, move rename it, move
    192192                // it and delete the signup avatar dir
    193                 if ( file_exists( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $hashed_key ) )
    194                         @rename( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $hashed_key, BP_AVATAR_UPLOAD_PATH . '/avatars/' . $user );
     193                if ( file_exists( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key ) )
     194                        @rename( bp_core_avatar_upload_path() . '/avatars/signups/' . $hashed_key, bp_core_avatar_upload_path() . '/avatars/' . $user );
    195195
    196196                bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
    … …  
    550550                return false;
    551551
    552         $path  = BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $bp->signup->avatar_dir;
     552        $path  = bp_core_avatar_upload_path() . '/avatars/signups/' . $bp->signup->avatar_dir;
    553553        $newbdir = $path;
    554554
    … …  
    556556                @wp_mkdir_p( $path );
    557557
    558         $newurl = BP_AVATAR_URL . '/avatars/signups/' . $bp->signup->avatar_dir;
     558        $newurl = bp_core_avatar_url() . '/avatars/signups/' . $bp->signup->avatar_dir;
    559559        $newburl = $newurl;
    560560        $newsubdir = '/avatars/signups/' . $bp->signup->avatar_dir;
  • trunk/bp-members/bp-members-template.php

    r4627 r4632  
    995995
    996996                $defaults = array(
    997                         'size' => BP_AVATAR_FULL_WIDTH,
     997                        'size' => bp_core_avatar_full_width(),
    998998                        'class' => 'avatar',
    999999                        'alt' => __( 'Your Avatar', 'buddypress' )
  • trunk/bp-themes/bp-default/activity/entry.php

    r4611 r4632  
    8282
    8383                        <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>>
    84                                 <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
     84                                <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?></div>
    8585                                <div class="ac-reply-content">
    8686                                        <div class="ac-textarea">
  • trunk/bp-themes/bp-default/activity/post-form.php

    r3810 r4632  
    2222        <div id="whats-new-avatar">
    2323                <a href="<?php echo bp_loggedin_user_domain(); ?>">
    24                         <?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?>
     24                        <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
    2525                </a>
    2626        </div>
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r4612 r4632  
    349349                $directory = 'avatars';
    350350
    351         $path    = BP_AVATAR_UPLOAD_PATH . '/avatars/' . $user_id;
     351        $path    = bp_core_avatar_upload_path() . '/avatars/' . $user_id;
    352352        $newbdir = $path;
    353353
    … …  
    355355                @wp_mkdir_p( $path );
    356356
    357         $newurl    = BP_AVATAR_URL . '/avatars/' . $user_id;
     357        $newurl    = bp_core_avatar_url() . '/avatars/' . $user_id;
    358358        $newburl   = $newurl;
    359359        $newsubdir = '/avatars/' . $user_id;
Note: See TracChangeset for help on using the changeset viewer.