[resolved] FB Avatar for Buddypress with WP-FB-Autoconnect (2 posts)

  1. dassoubarna
    Posted 3 years ago #

    Thanks Justin for a great plugin.

    Presently I am working on a Buddypress community forum. In buddypress avatars stores in a directory named with the ID of the member at "wp-content/upload/avatars" and avatar images suffix with -bpthumb/-bpfull.

    I have seen that FB-Connect caches FB Avatar and stores them in a pre-defined directory at "wp-content/upload/facebook-avatars" with the file name starts with user ID and end with -Full or -Thumb.

    My question is, is it possible to create a directory named as User's ID and avatars images end with -bpfull/-bpthumb instead of _Full/_Thumb?

    I have found the code in "_process_login.php" which may stores the FB Profile pictures as WP Avatars.

    if( $fbuser['pic_square'] )
        if( isset($fbuser['pic_square']['data']['url']) ) $avatarThumb = $fbuser['pic_square']['data']['url'];
    	else 											  $avatarThumb = $fbuser['pic_square'];
        if( isset($fbuser['pic_big']['data']['url']) )    $avatarFull = $fbuser['pic_big']['data']['url'];
    	else 											  $avatarFull = $fbuser['pic_big'];
    	update_user_meta($user_login_id, 'facebook_avatar_full', $avatarFull);
    	update_user_meta($user_login_id, 'facebook_avatar_thumb', $avatarThumb);
    	$jfb_log .= "WP: Updated small avatar ($avatarThumb)\n";
    	$jfb_log .= "WP: Updated large avatar ($avatarFull)\n";
        update_user_meta($user_login_id, 'facebook_avatar_thumb', '');
        update_user_meta($user_login_id, 'facebook_avatar_full', '');
        $jfb_log .= "FB: User does not have a profile picture; clearing cached avatar (if present).\n";

    I am not an expert in PHP coding but I can understand it little bit. I think if I modify this section then I may able to fulfill my requirement.

    Could you please help me to guide how can I do that? Pleas!!

    And sorry for my bad english as I am not a english speaking person.


  2. justin_k
    Plugin Author

    Posted 3 years ago #

    1) Support for this plugin is here: http://www.justin-klein.com/projects/wp-fb-autoconnect

    2) That code does not cache the avatar; it simply stores the URL of the original Facebook image in usermeta. Caching is a feature of the premium addon.

    3) You should never modify a plugin's code directly. You can use the hooks and filters documented at the above link to modify the behavior as needed.

    4) Please see FAQ36 (http://www.justin-klein.com/projects/wp-fb-autoconnect#faq36).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-FB-AutoConnect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.