[SOLVED] Show larger avatar images from Facebook

11 years 7 months ago #209878 by chrizuk
Evening All,

Ok so I've been racking my brains for a few hours now trying to find a way to pull the large picture from a user's Facebook profile.

The original code located in cb.facebookconnect.php

Line 969:
$request							=	cbfacebookconnectClass::httpRequest( 'https://graph.facebook.com/' . $id . '?fields=id,username,name,email,picture&type=large' . $token );

This always returns a the profile picture as a 50x50 image no matter what size your original Facebook profile picture is.

Replace with:
$request							=	cbfacebookconnectClass::httpRequest( 'https://graph.facebook.com/' . $id . '?fields=id,username,name,email,picture.type(large)' . $token  );

This will always pull the large profile picture (about 200 pixels wide, variable height) according to the API docs.

Hope this helps,

Chris
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

11 years 7 months ago #209909 by krileon
Thank you for your findings. Have fixed for next release. I don't see this usage documented anywhere however; mind providing source link?


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 7 months ago #209911 by chrizuk
Funnily enough the code never came from the Facebook API docs, I was reading a post over on stackoverflow that related to Apple iOS code (Which I thought strange).

The about 200 pixels wide, variable height part was found in Facebook API docs.

Chris

Please Log in to join the conversation.

11 years 7 months ago #209914 by krileon
Strange, I confirmed is working. Will be included with next release, thanks again.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 7 months ago #209954 by chrizuk
No problem B)

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.193 seconds

Facebook Twitter LinkedIn