Premium extensions BuddyPress Profile Photo
June 29, 2024 at 4:56 AMThe BuddyPress Profile Photo extension converts the Active Directory attributes thumbnailPhoto, jpegPhoto and thumbnailLogo into a BuddyPress profile photo.
Requirements
You need Next Active Directory Integration installed and already configured.
Usage
Activation
- Download the premium extension
- Copy the extracted ZIP file into your wp-content/plugins directory
- Activate the plug-in in your WordPress plug-in view
Configure BuddyPress
In BuddyPress, you have to enable the Extended Profile below Settings > BuddyPress > Components:
Setup NADI
Make sure that you have mapped the field thumbnailPhoto, jpegPhoto or thumbnailLogo in NADI. Please get in touch with your AD administrator to pick the right attribute. Configure the mapping on the Attributes tab:
Save the mapping. With the next login of the user or the next Sync to WordPress run the user’s profile picture gets updated.
FAQ
What happens if I map more than one AD photo attribute?
The extension checks the attributes in the order of thumbnailPhoto, jpegPhoto, thumbnailLogo. The first attribute containing atleast one byte is used.
What happens if the attribute does not contain a valid photo?
The extension will fail. Please let your AD administrator know that the user has invalid photo data.
How can I adjust the BudyPress avatar size ?
You can edit the BuddyPress avatar size in the following file “wp-content/plugins/buddypress/bp-core/bp-core-avatars.php”. If your Active Directory profile pictures have a size of 64x64px you have to change the following lines.
if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
define( 'BP_AVATAR_THUMB_WIDTH', 64 );
if ( !defined( 'BP_AVATAR_THUMB_HEIGHT' ) )
define( 'BP_AVATAR_THUMB_HEIGHT', 64 );
if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
define( 'BP_AVATAR_FULL_WIDTH', 64 );
if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
define( 'BP_AVATAR_FULL_HEIGHT', 64 );
BuddyPress crops the avatar images from the Active Directory. How can I disable the cropping of avatars?
BuddyPress crops all images by default, so this is not exactly a NADI-related questions. Open a file which is automatically picked up by WordPress, e.g.:
- the file wp-content/themes/${MY_THEME}/functions.php
- or create a new file wp-content/plugins/bp-disable-crop/index.php and enable the plug-in after you have added the code snippet
Put the following code snippet into the file
function disable_bp_crop($a, $b) {
return false;
}
add_filter('bp_core_pre_avatar_handle_crop', 'disable_bp_crop', 5, 2);
Error “Could not synchronize profile photos to BuddyPress: BuddyPress is not activated”
Make sure, that you have
- enabled BuddyPress in your WordPress plug-in directory
- activated Extended Profile below Settings > BuddyPress > Components.