Show
Ignore:
Timestamp:
06/19/08 17:10:30 (7 months ago)
Author:
apeatling
Message:

Fixed issues with subdirectory WPMU installations and BuddyPress

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-signup.php

    r158 r167  
    291291function xprofile_on_activate( $blog_id = null, $user_id = null ) { 
    292292        global $wpdb, $profile_picture_path; 
    293          
     293 
    294294        // Extract signup meta fields to fill out profile 
    295295        $field_ids = get_blog_option( $blog_id, 'xprofile_field_ids' ); 
    296296        $field_ids = explode( ",", $field_ids ); 
    297                  
     297                         
    298298        // Get the new user ID. 
    299299        $sql = "SELECT u.ID from " . $wpdb->base_prefix . "users u,  
     
    302302                        AND um.meta_key = 'primary_blog' 
    303303                        AND um.meta_value = " . $blog_id; 
    304                          
     304 
    305305        $user_id = $wpdb->get_var($sql);  
    306306 
     
    326326        if ( $resized && $original ) { 
    327327                $upload_dir = bp_upload_dir(NULL, $blog_id); 
    328                  
     328 
    329329                if ( $upload_dir ) { 
    330330                        $resized_strip_path = explode( '/', $resized ); 
     
    349349                // Render the cropper UI 
    350350                $action = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/wp-activate.php?key=' . $_GET['key'] . '&cropped=true'; 
    351                 xprofile_render_avatar_cropper($original, $resized, $action); 
     351                xprofile_render_avatar_cropper($original, $resized, $action, $user_id); 
    352352                 
    353353                //$result = xprofile_avatar_cropstore( $image, $image, $v1_x, $v1_y, XPROFILE_AVATAR_V1_W, XPROFILE_AVATAR_V1_H, $v2_x, $v2_y, XPROFILE_AVATAR_V2_W, XPROFILE_AVATAR_V2_H, true ); 
     
    368368                 
    369369                $user_id = xprofile_get_user_by_key($_GET['key']); 
    370                  
     370 
    371371                if ( $user_id && isset($_POST['orig']) && isset($_POST['canvas']) ) { 
     372                        echo "test is in here"; 
    372373                        xprofile_check_crop( $_POST['orig'], $_POST['canvas'] ); 
    373374                        $result = xprofile_avatar_cropstore( $_POST['orig'], $_POST['canvas'], $_POST['v1_x1'], $_POST['v1_y1'], $_POST['v1_w'], $_POST['v1_h'], $_POST['v2_x1'], $_POST['v2_y1'], $_POST['v2_w'], $_POST['v2_h'] ); 
    374375                        xprofile_avatar_save($result, $user_id); 
    375376                } 
    376  
     377                 
    377378                if ( VHOST == 'yes' ) { 
    378                         header('Location: http://' . $_SERVER['HTTP_HOST']); 
     379                        $url = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/'; 
    379380                } else { 
    380                         $path = explode( '/', $_SERVER['REQUEST_URI'] ); 
    381                         header( 'Location:' . $path[0] . $path[1] . $path[2] ); 
     381                        $url = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/' . get_usermeta( $user_id, 'nickname' ); 
    382382                } 
     383                 
     384                header("Location: $url"); 
    383385        } 
    384386}