Changeset 167

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

Fixed issues with subdirectory WPMU installations and BuddyPress

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r166 r167  
    1515} 
    1616 
    17 function bpcore_setup() { 
    18         global $current_user, $source_domain, $bp_nav; 
    19          
    20         $source_domain = 'http://' . get_usermeta( $current_user->ID, 'source_domain' ) . '/'; 
     17function bp_core_setup() { 
     18        global $current_user, $loggedin_domain, $loggedin_userid; 
     19        global $current_domain, $current_userid, $bp_nav; 
     20         
     21        $loggedin_domain = bp_core_get_loggedin_domain(); 
     22        $loggedin_userid = $current_user->ID; 
     23         
     24        $current_domain = bp_core_get_current_domain(); 
     25        $current_userid = bp_core_get_current_userid(); 
    2126         
    2227        $bp_nav[1] = array( 
    2328                'id'    => 'blog', 
    2429                'name'  => 'Blog',  
    25                 'link'  => $source_domain . 'blog' 
     30                'link'  => $loggedin_domain . 'blog' 
    2631        ); 
    2732} 
    28 add_action( 'wp', 'bpcore_setup' ); 
     33add_action( 'wp', 'bp_core_setup' ); 
     34 
     35function bp_core_get_loggedin_domain() { 
     36        global $current_user; 
     37         
     38        if ( VHOST == 'yes' ) { 
     39                $loggedin_domain = 'http://' . get_usermeta( $current_user->ID, 'source_domain' ) . '/'; 
     40        } else { 
     41                $loggedin_domain = 'http://' . get_usermeta( $current_user->ID, 'source_domain' ) . '/' . get_usermeta( $current_user->ID, 'user_login' ) . '/'; 
     42        } 
     43 
     44        return $loggedin_domain; 
     45} 
     46 
     47function bp_core_get_current_domain() { 
     48        global $current_blog; 
     49         
     50        if ( VHOST == 'yes' ) { 
     51                $current_domain = 'http://' . $current_blog->domain . '/'; 
     52        } else { 
     53                $current_domain = get_bloginfo('wpurl') . '/'; 
     54        } 
     55         
     56        return $current_domain; 
     57} 
     58 
     59function bp_core_get_current_userid() { 
     60        $siteuser = bp_core_get_primary_username(); 
     61        $current_userid = bp_core_get_userid($siteuser); 
     62         
     63        return $current_userid; 
     64} 
     65 
     66function bp_core_get_primary_username() { 
     67        global $current_blog; 
     68         
     69        if ( VHOST == 'yes' ) { 
     70                $siteuser = explode('.', $current_blog->domain); 
     71                $siteuser = $siteuser[0]; 
     72        } else { 
     73                $siteuser = str_replace('/', '', $current_blog->path); 
     74        } 
     75         
     76        return $siteuser; 
     77} 
    2978 
    3079function start_buffer() { 
     
    353402} 
    354403 
    355  
    356 // get the IDs of user blogs in a comma-separated list for use in SQL statements 
    357 function bp_get_blog_ids_of_user( $id, $all = false ) { 
    358         $blogs = get_blogs_of_user( $id, $all ); 
    359         $blog_ids = ""; 
    360          
    361         if ( $blogs && count($blogs) > 0 ){ 
    362                 foreach( $blogs as $blog ) { 
    363                         $blog_ids .= $blog->blog_id.","; 
    364                 } 
    365         } 
    366         $blog_ids = trim( $blog_ids, "," ); 
    367         return $blog_ids; 
    368 } 
    369  
    370 // return a tick for a checkbox for a true boolean value 
    371 function bp_boolean_ticked($bool) { 
    372         if ( $bool ) { 
    373                 return " checked=\"checked\""; 
    374         } 
    375         return ""; 
    376 } 
    377  
    378 // return a tick for a checkbox for a particular value 
    379 function bp_value_ticked( $var, $value ) { 
    380         if ( $var == $value ) { 
    381                 return " checked=\"checked\""; 
    382         } 
    383         return ""; 
    384 } 
    385  
    386 // return true for a boolean value from a checkbox 
    387 function bp_boolean( $value = 0 ) { 
    388         if ( $value != "" ) { 
    389                 return 1; 
    390         } else { 
    391                 return 0; 
    392         } 
    393 } 
    394  
    395 // return an integer 
    396 function bp_int( $var, $nullToOne=false ) { 
    397         if ( @$var == "" ) { 
    398                 if ( $nullToOne ) { 
    399                         return 1; 
    400                 } else { 
    401                         return 0; 
    402                 } 
    403         } else { 
    404                 return (int)$var; 
    405         } 
    406 } 
    407  
    408  
    409 // show a friendly date 
    410 function bp_friendly_date($timestamp) { 
    411         // set the timestamp to now if it hasn't been given 
    412         if ( strlen($timestamp) == 0 ) 
    413                 $timestamp = time(); 
    414          
    415         // create the date string 
    416         if ( date( "m", $timestamp ) == date("m") && date( "d", $timestamp ) == date("d") - 1 && date( "Y", $timestamp ) == date("Y") ) { 
    417                 return "yesterday at " . date( "g:i a", $timestamp ); 
    418         } else if ( date( "m", $timestamp ) == date("m") && date( "d", $timestamp ) == date("d") && date( "Y", $timestamp ) == date("Y") ) { 
    419                 return "at " . date( "g:i a", $timestamp ); 
    420         } else if ( date( "m", $timestamp) == date("m") && date( "d", $timestamp ) > date("d") - 5 && date( "Y", $timestamp ) == date("Y") ) { 
    421                 return "on " . date( "l", $timestamp ) . " at " . date( "g:i a", $timestamp ); 
    422         } else if ( date( "Y", $timestamp) == date("Y") ) { 
    423                 return "on " . date( "F jS", $timestamp ); 
    424         } else { 
    425                 return "on " . date( "F jS Y", $timestamp ); 
    426         } 
    427 } 
    428  
    429 // search users 
    430 function bp_search_users( $q, $start = 0, $num = 10 ) { 
    431         if ( trim($q) != "" ) { 
    432                 global $wpdb; 
    433                 global $current_user; 
    434                  
    435                 $sql = "SELECT SQL_CALC_FOUND_ROWS id, user_login, display_name, user_nicename 
    436                                 FROM " . $wpdb->base_prefix . "users 
    437                                 WHERE (user_nicename like '%" . $wpdb->escape($q) . "%' 
    438                                 OR user_email like '%" . $wpdb->escape($q) . "%' 
    439                                 OR display_name like '%" . $wpdb->escape($q) . "%') 
    440                                 AND (id <> " . $current_user->ID . " and id > 1) 
    441                                 LIMIT " . $wpdb->escape($start) . ", " . $wpdb->escape($num) . ";"; 
    442  
    443                 if ( !$users = $wpdb->get_results($sql) ) { 
    444                         return false; 
    445                 } 
    446                  
    447                 $rows = $wpdb->get_var( "SELECT found_rows() AS found_rows" ); 
    448                  
    449                 if ( is_array($users) && count($users) > 0 ) { 
    450                         for ( $i = 0; $i < count($users); $i++ ) { 
    451                                 $user          = $users[$i]; 
    452                                 $user->siteurl = $user->user_url; 
    453                                 $user->blogs   = ""; 
    454                                 $user->blogs   = get_blogs_of_user($user->id); 
    455                                 $user->rows    = $rows; 
    456                         } 
    457                         return $users; 
    458                 } else { 
    459                         return false; 
    460                 } 
    461         } else { 
    462                 return false; 
    463         } 
    464 } 
    465  
    466 // return a ' if the text ends in an "s", or "'s" otherwise 
    467 function bp_end_with_s( $string ) { 
    468         if ( substr( strtolower($string), - 1 ) == "s" ) { 
    469                 return $string . "'"; 
    470         } else { 
    471                 return $string . "'s"; 
    472         } 
    473 } 
    474  
    475 // pluralise a string 
    476 function bp_plural( $num, $ifone = "", $ifmore = "s" ) { 
    477         if ( bp_int($num) != 1 ) { 
    478                 return $ifmore; 
    479         } else { 
    480                 return $ifone; 
    481         } 
    482 } 
    483  
    484404function bp_is_serialized( $data ) { 
    485405   if ( trim($data) == "" ) { 
  • trunk/bp-core/bp-core-templatetags.php

    r166 r167  
    22 
    33function bp_get_nav() { 
    4         global $bp_nav, $current_component; 
     4        global $bp_nav, $current_component, $current_userid, $loggedin_userid; 
    55         
    66        for ( $i = 0; $i < count($bp_nav); $i++ ) { 
    7                 if ( $current_component == $bp_nav[$i]['id'] ) { 
     7                if ( $current_component == $bp_nav[$i]['id'] && $current_userid == $loggedin_userid ) { 
    88                        $selected = ' class="current"'; 
    99                } else { 
  • trunk/bp-xprofile.php

    r166 r167  
    136136 
    137137function xprofile_setup_nav() { 
    138         global $source_domain, $bp_nav, $bp_options_nav, $bp_xprofile_slug; 
    139  
     138        global $loggedin_domain, $bp_nav, $bp_options_nav; 
     139        global $loggedin_userid, $current_userid, $bp_xprofile_slug; 
     140         
    140141        $bp_nav[0] = array( 
    141142                'id'    => $bp_xprofile_slug, 
    142143                'name'  => 'Profile',  
    143                 'link'  => $source_domain . $bp_xprofile_slug 
     144                'link'  => $loggedin_domain . $bp_xprofile_slug 
    144145        ); 
    145146 
    146         $bp_options_nav[$bp_xprofile_slug] = array( 
    147                 ''                 => array(  
    148                         'name' => __('Publically Viewable'), 
    149                         'link' => $source_domain . $bp_xprofile_slug . '/' ), 
    150                 'edit'                  => array( 
    151                         'name' => __('Edit Profile'), 
    152                         'link' => $source_domain . $bp_xprofile_slug . '/edit' ), 
    153                 'change-avatar' => array(  
    154                         'name' => __('Change Avatar'), 
    155                         'link' => $source_domain . $bp_xprofile_slug . '/change-avatar' ) 
    156         ); 
     147        if ( $loggedin_userid == $current_userid ) { 
     148                $bp_options_nav[$bp_xprofile_slug] = array( 
     149                        ''                 => array(  
     150                                'name' => __('Publically Viewable'), 
     151                                'link' => $loggedin_domain . $bp_xprofile_slug . '/' ), 
     152                        'edit'                  => array( 
     153                                'name' => __('Edit Profile'), 
     154                                'link' => $loggedin_domain . $bp_xprofile_slug . '/edit' ), 
     155                        'change-avatar' => array(  
     156                                'name' => __('Change Avatar'), 
     157                                'link' => $loggedin_domain . $bp_xprofile_slug . '/change-avatar' ) 
     158                ); 
     159        } 
    157160} 
    158161add_action( 'wp', 'xprofile_setup_nav' ); 
     
    166169 
    167170function xprofile_catch_action() { 
    168         global $bp_xprofile_slug, $current_component, $current_blog, $current_action; 
     171        global $bp_xprofile_slug, $current_component, $current_blog; 
     172        global $loggedin_userid, $current_userid, $current_action; 
    169173 
    170174        if ( $current_component == $bp_xprofile_slug && $current_blog->blog_id > 1 ) { 
    171                 if ( !$current_action ) 
     175                if ( !$current_action ) { 
    172176                        bp_catch_uri( 'profile/index' ); 
    173  
    174                 if ( $current_action == 'edit' && !$action_variables ) 
     177                } else if ( $current_action == 'edit' && !$action_variables && $loggedin_userid == $current_userid ) { 
    175178                        bp_catch_uri( 'profile/edit' ); 
    176  
    177                 if ( $current_action == 'change-avatar' ) 
     179                } else if ( $current_action == 'change-avatar' && $loggedin_userid == $current_userid ) { 
    178180                        bp_catch_uri( 'profile/change-avatar' ); 
     181                } else { 
     182                        bp_catch_uri( 'profile/index' ); 
     183                } 
    179184        } 
    180185} 
     
    190195 
    191196function xprofile_profile_template() { 
    192         global $current_blog, $profile_template, $coreuser_id; 
    193  
    194         if ( VHOST == 'yes' ) { 
    195                 $siteuser = explode('.', $current_blog->domain); 
    196                 $siteuser = $siteuser[0]; 
    197         } else { 
    198                 $siteuser = str_replace('/', '', $current_blog->path); 
    199         } 
    200  
    201         $coreuser_id = bp_core_get_userid($siteuser); 
    202         $profile_template = new BP_XProfile_Template($coreuser_id); 
     197        global $profile_template, $current_userid; 
     198 
     199        $profile_template = new BP_XProfile_Template($current_userid); 
    203200} 
    204201add_action( 'wp_head', 'xprofile_profile_template' ); 
     
    212209 
    213210function xprofile_edit( $group_id = null, $action = null ) { 
    214         global $wpdb, $bp_xprofile_table_name_groups, $userdata, $source_domain; 
     211        global $wpdb, $bp_xprofile_table_name_groups, $userdata, $loggedin_domain; 
    215212         
    216213        if ( !$group_id ) {      
     
    225222         
    226223        if ( !$action ) 
    227                 $action = $source_domain . 'wp-admin/admin.php?page=xprofile_' . $group->name . '&amp;mode=save'; 
     224                $action = $loggedin_domain . 'wp-admin/admin.php?page=xprofile_' . $group->name . '&amp;mode=save'; 
    228225?> 
    229226        <div class="wrap"> 
  • trunk/bp-xprofile/bp-xprofile-avatars.php

    r166 r167  
    6767 
    6868// Main UI Rendering 
    69 function xprofile_avatar_admin($message = null) { 
     69function xprofile_avatar_admin($message = null, $action = null) { 
    7070        ?>       
    7171        <?php if ( !isset($_POST['slick_avatars_action']) && !isset($_GET['slick_avatars_action']) ) { ?> 
     
    8484                 
    8585                <?php 
    86                 $action = get_option('home') . '/wp-admin/admin.php?page=bp-xprofile.php'; 
     86                if ( !$action ) 
     87                        $action = get_option('home') . '/wp-admin/admin.php?page=bp-xprofile.php'; 
     88                 
    8789                xprofile_render_avatar_upload_form($action); 
    8890 
     
    128130                 
    129131                // Render the cropper UI 
    130                 $action = get_option('home') .'/wp-admin/admin.php?page=bp-xprofile.php'; 
     132                if ( !$action ) 
     133                        $action = get_option('home') .'/wp-admin/admin.php?page=bp-xprofile.php'; 
     134                 
    131135                xprofile_render_avatar_cropper($original, $canvas, $action); 
    132136                 
     
    224228} 
    225229 
    226 function xprofile_render_avatar_cropper($original, $new, $action) { 
     230function xprofile_render_avatar_cropper($original, $new, $action, $user_id = null) { 
    227231        $size = getimagesize($new); 
    228232         
    229         // Get the URL to access the uploaded file 
    230         $url = get_usermeta( get_current_user_id(), 'source_domain' ); 
     233        if ( !$user_id ) 
     234                $user_id = get_current_user_id(); 
     235         
     236        if ( VHOST == 'yes' ) { 
     237                $url = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/'; 
     238        } else { 
     239                $url = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/' . get_usermeta( $user_id, 'nickname' ) . '/'; 
     240        } 
     241 
    231242        $src = str_replace( array(ABSPATH), array($url . '/'), $new ); 
    232          
     243 
    233244        // Load cropper details 
    234245         
     
    354365        if ( !$user_id ) 
    355366                $user_id = get_current_user_id(); 
     367                 
     368        if ( VHOST == 'yes' ) { 
     369                $src = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/'; 
     370        } else { 
     371                $src = 'http://' . get_usermeta( $user_id, 'source_domain' ) . '/' . get_usermeta( $user_id, 'nickname' ) . '/'; 
     372        } 
    356373         
    357374        $old = get_usermeta( $user_id, 'xprofile_avatar_v1_path' ); 
    358         $v1_href = str_replace( array(ABSPATH), array( 'http://' . get_usermeta( get_current_user_id(), 'source_domain' ) . '/' ), $vars['v1_out'] ); 
     375        $v1_href = str_replace( array(ABSPATH), array($src), $vars['v1_out'] ); 
    359376        update_usermeta( $user_id, 'xprofile_avatar_v1', $v1_href ); 
    360377        update_usermeta( $user_id, 'xprofile_avatar_v1_path', $vars['v1_out'] ); 
     
    363380        if ( XPROFILE_AVATAR_V2_W !== false && XPROFILE_AVATAR_V2_H !== false ) { 
    364381                $old = get_usermeta( $user_id, 'xprofile_avatar_v2_path' ); 
    365                 $v2_href = str_replace( array(ABSPATH), array( 'http://' . get_usermeta( get_current_user_id(), 'source_domain' ) . '/' ), $vars['v2_out'] ); 
     382                $v2_href = str_replace( array(ABSPATH), array($src), $vars['v2_out'] ); 
    366383                update_usermeta( $user_id, 'xprofile_avatar_v2', $v2_href ); 
    367384                update_usermeta( $user_id, 'xprofile_avatar_v2_path', $vars['v2_out'] ); 
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r162 r167  
    10771077         
    10781078        function get_value_byid( $field_id, $user_id = null ) { 
    1079                 global $wpdb, $coreuser_id, $bp_xprofile_table_name_data; 
     1079                global $wpdb, $current_userid, $bp_xprofile_table_name_data; 
    10801080 
    10811081                if ( !$user_id ) 
    1082                         $user_id = $coreuser_id; 
     1082                        $user_id = $current_userid; 
    10831083 
    10841084                $sql = $wpdb->prepare("SELECT * FROM $bp_xprofile_table_name_data WHERE field_id = %d AND user_id = %d", $field_id, $user_id ); 
     
    10921092         
    10931093        function get_value_byfieldname( $fields, $user_id = null ) { 
    1094                 global $coreuser_id, $wpdb, $bp_xprofile_table_name_fields, $bp_xprofile_table_name_data; 
     1094                global $current_userid, $wpdb, $bp_xprofile_table_name_fields, $bp_xprofile_table_name_data; 
    10951095 
    10961096                if ( !$fields ) 
     
    10981098 
    10991099                if ( !$user_id ) 
    1100                         $user_id = $coreuser_id; 
     1100                        $user_id = $current_userid; 
    11011101 
    11021102                if ( is_array($fields) ) { 
  • 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'] . '&amp;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} 
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r166 r167  
    210210 
    211211function bp_the_avatar() { 
    212         global $coreuser_id; 
    213         echo xprofile_get_avatar( $coreuser_id, 2 ); 
     212        global $current_userid; 
     213        echo xprofile_get_avatar( $current_userid, 2 ); 
    214214} 
    215215 
    216216function bp_the_avatar_thumbnail() { 
    217         global $coreuser_id; 
    218         echo xprofile_get_avatar( $coreuser_id, 1 ); 
     217        global $current_userid; 
     218        echo xprofile_get_avatar( $current_userid, 1 ); 
    219219} 
    220220 
    221221function bp_loggedinuser_avatar_thumbnail() { 
    222         global $current_user; 
    223         echo xprofile_get_avatar( $current_user->ID, 1 ); 
     222        global $loggedin_userid; 
     223        echo xprofile_get_avatar( $loggedin_userid, 1 ); 
    224224} 
    225225 
    226226function bp_user_fullname($user_id = false) { 
    227         global $coreuser_id; 
     227        global $current_userid; 
    228228         
    229229        if ( !$user_id ) 
    230                 $user_id = $coreuser_id; 
     230                $user_id = $current_userid; 
    231231         
    232232        $data = bp_get_field_data( array( 'First Name', 'Last Name' ) ); 
     
    248248 
    249249function bp_profile_group_tabs() { 
    250         global $source_domain, $bp_xprofile_slug, $group_name; 
     250        global $loggedin_domain, $bp_xprofile_slug, $group_name; 
    251251         
    252252        $groups = BP_XProfile_Group::get_all(); 
     
    262262                } 
    263263 
    264                 echo '<li' . $selected . '><a href="' . $source_domain . $bp_xprofile_slug . '/edit/group/' . $groups[$i]->id . '">' . $groups[$i]->name . '</a></li>'; 
     264                echo '<li' . $selected . '><a href="' . $loggedin_domain . $bp_xprofile_slug . '/edit/group/' . $groups[$i]->id . '">' . $groups[$i]->name . '</a></li>'; 
    265265        } 
    266266} 
     
    284284 
    285285function bp_edit_profile_form() { 
    286         global $action_variables, $source_domain, $bp_xprofile_slug; 
     286        global $action_variables, $loggedin_domain, $bp_xprofile_slug; 
    287287 
    288288        $group_id = $action_variables[1]; 
     
    291291                $group_id = 1; // 'Basic' group. 
    292292         
    293         xprofile_edit( $group_id, $source_domain . $bp_xprofile_slug . '/edit/group/' . $group_id . '/?mode=save' ); 
    294 } 
    295  
    296  
     293        xprofile_edit( $group_id, $loggedin_domain . $bp_xprofile_slug . '/edit/group/' . $group_id . '/?mode=save' ); 
     294} 
     295 
     296function bp_avatar_upload_form() { 
     297        global $loggedin_domain, $bp_xprofile_slug; 
     298          
     299        xprofile_avatar_admin(null, $loggedin_domain . $bp_xprofile_slug . '/change-avatar/'); 
     300} 
    297301 
    298302