Advertisement:

Author Topic: How to get Picture from user login with Facebook ?  (Read 2714 times)

strata

  • Sr. Member
  • ****
  • Posts: 411
  • Always good, always...
How to get Picture from user login with Facebook ?
« on: March 15, 2014, 04:45:55 pm »
Hi, anyone have idea how to display user picture after success login with Facebook ?
any help would be much appreciate.
thank you all.

volunteer

  • Full Member
  • ***
  • Posts: 241
Re: How to get Picture from user login with Facebook ?
« Reply #1 on: April 06, 2014, 02:00:46 pm »
to fetch the profile photo from fb you mean?

strata

  • Sr. Member
  • ****
  • Posts: 411
  • Always good, always...
Re: How to get Picture from user login with Facebook ?
« Reply #2 on: April 06, 2014, 04:35:05 pm »
to fetch the profile photo from fb you mean?
Yes friends :D
That's exactly what I needed

ozarkprime

  • Newbie
  • *
  • Posts: 23
Re: How to get Picture from user login with Facebook ?
« Reply #3 on: June 06, 2014, 10:34:00 am »

volunteer

  • Full Member
  • ***
  • Posts: 241
Re: How to get Picture from user login with Facebook ?
« Reply #4 on: June 06, 2014, 02:46:22 pm »
doesnt work for me  ???

ozarkprime

  • Newbie
  • *
  • Posts: 23
Re: How to get Picture from user login with Facebook ?
« Reply #5 on: June 13, 2014, 05:09:16 am »
did you change the word username to the persons facebook username?

volunteer

  • Full Member
  • ***
  • Posts: 241
Re: How to get Picture from user login with Facebook ?
« Reply #6 on: June 13, 2014, 10:18:37 am »
I used this
function fbc_button2() {
        $user = OSCFacebook::newInstance()->getUser();

        if( $user && osc_is_web_user_logged_in() ) {
            echo '<img src="https://graph.facebook.com/' . $user . '/picture" style="float:right;">';
            //echo '<a href="' . OSCFacebook::newInstance()->logoutUrl() . '">' . __( 'Logout', 'facebook' ) . '</a>';
       
        }
    }

Being that the first button for facebook is to log in or out, I used another function call to show their image. So in facebook plugin index, put the above and where you want their image put <?php fbc_button2(); ?>

ozarkprime

  • Newbie
  • *
  • Posts: 23
Re: How to get Picture from user login with Facebook ?
« Reply #7 on: June 13, 2014, 08:10:17 pm »
print_r($user) and tell me what it gives you