Changeset 1709 for trunk/bp-groups.php
- Timestamp:
- 08/26/2009 06:18:56 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r1708 r1709 74 74 75 75 foreach ( $groups as $group ) { 76 /* Don't fetch and move gravs */77 if ( strpos( $group->avatar_thumb, 'gravatar.com' ) )76 /* Don't fetch and move gravs, default images or empties */ 77 if ( empty($group->avatar_thumb) || strpos( $group->avatar_thumb, 'gravatar.com' ) || strpos( $group->avatar_thumb, 'identicon' ) || strpos( $group->avatar_thumb, 'none-thumbnail' ) ) 78 78 continue; 79 79 80 $upload_dir = groups_avatar_upload_dir( $group->id ); 81 $avatar_thumb = str_replace( $bp->root_domain . '/' . basename( WP_CONTENT_DIR ), WP_CONTENT_PATH, $group->avatar_thumb ); 82 $avatar_full = str_replace( $bp->root_domain . '/' . basename( WP_CONTENT_DIR ), WP_CONTENT_PATH, $group->avatar_full ); 83 84 copy( $avatar_thumb, $upload_dir['path'] . '/' . basename($avatar_thumb) ); 85 copy( $avatar_full, $upload_dir['path'] . '/' . basename($avatar_full) ); 80 $start = strpos( $group->avatar_thumb, 'blogs.dir' ); 81 82 if ( false !== $start ) { 83 $avatar_thumb = WP_CONTENT_DIR . '/' . substr( $group->avatar_thumb, $start, strlen( $group->avatar_thumb ) ); 84 $avatar_full = WP_CONTENT_DIR . '/' . substr( $group->avatar_full, $start, strlen( $group->avatar_full ) ); 85 86 if ( !file_exists( $avatar_thumb ) || !file_exists( $avatar_full ) ) 87 continue; 88 89 $upload_dir = groups_avatar_upload_dir( $group->id ); 90 91 copy( $avatar_thumb, $upload_dir['path'] . '/' . basename($avatar_thumb) ); 92 copy( $avatar_full, $upload_dir['path'] . '/' . basename($avatar_full) ); 93 } 86 94 } 87 95
Note: See TracChangeset
for help on using the changeset viewer.