• Neo

    (@neocsatornaja)


    Hy!
    I would like to crate a notification system for comments.
    Only one problem is, the profile pictures come from gravatar.com and I doesen’t can get from facebook.
    My js file is this
    So the simplest soulution for me, if the script can make a profile with user picture and user email, etc.
    Is that possible?

    https://www.ads-software.com/plugins/oa-social-login/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Premiumwp.ro

    (@bogdandin)

    Yes is possible to extract profile photo, if you have experience with programing you can look here.

    https://docs.oneall.com/plugins/guide/social-login-wordpress/#1
    https://docs.oneall.com/services/implementation-guide/social-login/

    Thread Starter Neo

    (@neocsatornaja)

    Sorry, I no have this programer skills.
    Can you help me?

    Denver

    (@denvw)

    If a user has logged in with Social Login, you can retrieve his avatar/picture with this code:

    $user_meta_thumbnail = get_user_meta ($user_id, 'oa_social_login_user_thumbnail', true);
    $user_meta_picture = get_user_meta ($user_id, 'oa_social_login_user_picture', true);
    Thread Starter Neo

    (@neocsatornaja)

    My code i looks like this:

    for ($n = $data[‘num’] – $data[‘end’]; $n < $data[‘num’]; $n++){
    if (empty($comments[$n]->comment_type)){
    $data[‘comments’][] = array(
    ‘username’ => $comments[$n]->comment_author,
    ‘text’ => str_replace(“\r\n”, “
    “, substr($comments[$n]->comment_content, 0, 50)).’…’,
    ‘url’ => get_permalink($comments[$n]->comment_post_ID).’#comment-‘.$comments[$n]->comment_ID,
    ‘image’ => get_gravatar($comments[$n]->comment_author_email, $s = 80, $d = ‘wavatar’, $r = ‘g’)
    );
    }
    }
    echo json_encode($data);
    exit;

    Where come your code?

    Thread Starter Neo

    (@neocsatornaja)

    Becouse if I modified this for this:

    for ($n = $data['num'] - $data['end']; $n < $data['num']; $n++){
    	if (empty($comments[$n]->comment_type)){
    		$data['comments'][] = array(
    			'username' => $comments[$n]->comment_author,
    			'text' => str_replace("\r\n", "<br />", substr($comments[$n]->comment_content, 0, 50)).'...',
    			'url' => get_permalink($comments[$n]->comment_post_ID).'#comment-'.$comments[$n]->comment_ID,
    			'image' => get_user_meta ($user_id, 'oa_social_login_user_picture', true)
    		);
    	}
    }
    echo json_encode($data);
    exit;

    I get this result:
    {“num”:904,”end”:1,”comments”:[{“username”:”Clever Bot”,”text”:”zzhjgjghgjj…”,”url”:”http:\/\/neocsatblog.mblx.hu\/teszt-oldal\/#comment-1089″,”image”:false}]}

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Auto create gravatar profile with profile picture?’ is closed to new replies.