Skip to:
Content

BuddyPress.org

Changeset 2609


Ignore:
Timestamp:
02/05/2010 03:09:16 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1817

Location:
trunk/bp-core
Files:
3 edited

Legend:

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

    r2576 r2609  
    4545
    4646        /* Check if the avatar folder exists. If it does, move rename it, move it and delete the signup avatar dir */
    47         if ( file_exists( WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/signups/' . $hashed_key ) ) {
    48             @rename( WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/signups/' . $hashed_key, WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/' . $signup['user_id'] );
     47        if ( file_exists( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $hashed_key ) ) {
     48            @rename( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $hashed_key, BP_AVATAR_UPLOAD_PATH . '/avatars/' . $signup['user_id'] );
    4949        }
    5050
  • trunk/bp-core/bp-core-signup.php

    r2583 r2609  
    186186            bp_core_add_message( __( 'Your new avatar was uploaded successfully', 'buddypress' ) );
    187187
     188        /* If this is a single WP install, move the avatar to the user's folder since there is no activation process to move it. */
     189        if ( !bp_core_is_multisite() ) {
     190            $user_id = bp_core_get_userid( $_POST['signup_username'] );
     191
     192            if ( !empty( $user_id ) && file_exists( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $_POST['signup_avatar_dir'] ) ) {
     193                @rename( BP_AVATAR_UPLOAD_PATH . '/avatars/signups/' . $_POST['signup_avatar_dir'], BP_AVATAR_UPLOAD_PATH . '/avatars/' . $user_id );
     194            }
     195        }
    188196    }
    189197    bp_core_load_template( 'registration/register' );
  • trunk/bp-core/bp-core-templatetags.php

    r2604 r2609  
    12261226        extract( $r, EXTR_SKIP );
    12271227
    1228         $signup_avatar_dir = ( !empty( $_POST['signup_avatar_dir'] ) ) ? $_POST['signup_avatar_dir'] : $bp->signup->avatar_dir;
    1229 
    1230         if ( empty( $signup_avatar_dir ) ) {
    1231             if ( empty( $bp->grav_default->user ) ) {
    1232                 $default_grav = 'wavatar';
    1233             } else if ( 'mystery' == $bp->grav_default->user ) {
    1234                 $default_grav = BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg';
     1228        if ( !bp_core_is_multisite() && !empty( $_POST['signup_username'] ) ) {
     1229            $user_id = bp_core_get_userid( $_POST['signup_username'] );
     1230            return apply_filters( 'bp_get_signup_avatar', bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full', 'width' => $size, 'height' => $size, 'alt' => $alt, 'class' => $class ) ) );
     1231        } else {
     1232            $signup_avatar_dir = ( !empty( $_POST['signup_avatar_dir'] ) ) ? $_POST['signup_avatar_dir'] : $bp->signup->avatar_dir;
     1233
     1234            if ( empty( $signup_avatar_dir ) ) {
     1235                if ( empty( $bp->grav_default->user ) ) {
     1236                    $default_grav = 'wavatar';
     1237                } else if ( 'mystery' == $bp->grav_default->user ) {
     1238                    $default_grav = BP_PLUGIN_URL . '/bp-core/images/mystery-man.jpg';
     1239                } else {
     1240                    $default_grav = $bp->grav_default->user;
     1241                }
     1242
     1243                $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );
     1244                return apply_filters( 'bp_get_signup_avatar', '<img src="' . $gravatar_url . md5( $_POST['signup_email'] ) . '?d=' . $default_grav . '&amp;s=' . $size ) . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class . '" />';
    12351245            } else {
    1236                 $default_grav = $bp->grav_default->user;
     1246                return apply_filters( 'bp_get_signup_avatar', bp_core_fetch_avatar( array( 'item_id' => $signup_avatar_dir, 'object' => 'signup', 'avatar_dir' => 'avatars/signups', 'type' => 'full', 'width' => $size, 'height' => $size, 'alt' => $alt, 'class' => $class ) ) );
    12371247            }
    1238 
    1239             $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' );
    1240             return apply_filters( 'bp_get_signup_avatar', '<img src="' . $gravatar_url . md5( $_POST['signup_email'] ) . '?d=' . $default_grav . '&amp;s=' . $size ) . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class . '" />';
    1241         } else {
    1242             return apply_filters( 'bp_get_signup_avatar', bp_core_fetch_avatar( array( 'item_id' => $signup_avatar_dir, 'object' => 'signup', 'avatar_dir' => 'avatars/signups', 'type' => 'full', 'width' => $size, 'height' => $size, 'alt' => $alt, 'class' => $class ) ) );
    12431248        }
    12441249    }
Note: See TracChangeset for help on using the changeset viewer.