WordPress.org

Ready to get started?Download WordPress

Forums

User Photo
Image through facebook is not showing. (2 posts)

  1. naveenbos
    Member
    Posted 6 months ago #

    I am using facebook all plugin and user-photo plugin for front end upload.
    The facebook all plugin piks the profile picture from the facebook. but in my edit profile page i am using userphoto_thumbnail($current_user->id) this code for getting uploaded image. how to check if the facebook user image is there and display that image in the edit profile page. means facebook logged In user have the facebook image and how i will display that image with a if condition in this else default image must shown is it possible?

    if(userphoto_exists($current_user))
        userphoto($current_user->id);
    elseif
        //facebook image
    elseif
        //default image

    https://wordpress.org/plugins/user-photo/

  2. naveenbos
    Member
    Posted 6 months ago #

    I would like to share the code that i did for a solution for the above question
    $fb_image = $wpdb->get_var("SELECT meta_value FROM $wpdb->usermeta WHEREuser_id= '".$current_user->id."' ANDmeta_key`='facebookall_user_thumbnail'");
    $fb_img = '<img src="'.$fb_image.'" height="128" width="128" alt="">';
    if(userphoto_exists($current_user)){
    userphoto($current_user->id);
    }
    elseif($fb_image!="") {
    echo $fb_img;
    }
    else{
    echo get_avatar($user->ID, 96);
    }`

Reply

You must log in to post.

About this Plugin

About this Topic