Thread Starter
Neo
(@neocsatornaja)
Sorry, I no have this programer skills.
Can you help me?
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}]}