Changeset 167 for trunk/bp-xprofile/bp-xprofile-avatars.php
- Timestamp:
- 06/19/08 17:10:30 (7 months ago)
- Files:
-
- 1 modified
-
trunk/bp-xprofile/bp-xprofile-avatars.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-avatars.php
r166 r167 67 67 68 68 // Main UI Rendering 69 function xprofile_avatar_admin($message = null ) {69 function xprofile_avatar_admin($message = null, $action = null) { 70 70 ?> 71 71 <?php if ( !isset($_POST['slick_avatars_action']) && !isset($_GET['slick_avatars_action']) ) { ?> … … 84 84 85 85 <?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 87 89 xprofile_render_avatar_upload_form($action); 88 90 … … 128 130 129 131 // 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 131 135 xprofile_render_avatar_cropper($original, $canvas, $action); 132 136 … … 224 228 } 225 229 226 function xprofile_render_avatar_cropper($original, $new, $action ) {230 function xprofile_render_avatar_cropper($original, $new, $action, $user_id = null) { 227 231 $size = getimagesize($new); 228 232 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 231 242 $src = str_replace( array(ABSPATH), array($url . '/'), $new ); 232 243 233 244 // Load cropper details 234 245 … … 354 365 if ( !$user_id ) 355 366 $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 } 356 373 357 374 $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'] ); 359 376 update_usermeta( $user_id, 'xprofile_avatar_v1', $v1_href ); 360 377 update_usermeta( $user_id, 'xprofile_avatar_v1_path', $vars['v1_out'] ); … … 363 380 if ( XPROFILE_AVATAR_V2_W !== false && XPROFILE_AVATAR_V2_H !== false ) { 364 381 $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'] ); 366 383 update_usermeta( $user_id, 'xprofile_avatar_v2', $v2_href ); 367 384 update_usermeta( $user_id, 'xprofile_avatar_v2_path', $vars['v2_out'] );
