简体   繁体   中英

Display Facebook photos on website

There are topics about statuses, walls and profiles, but none about photos...

What I'm trying to achieve is to display the photos of my page/profile/etc. onto my website. I stumbled upon an FQL method in combination with Lightbox. It seems to do everything I need, except for some reason the FaceBook API isn't connecting with Facebook. This array remains empty.

$fql = "SELECT aid, cover_pid, name FROM album WHERE owner=11239244970";
   $param  =   array(
     'method'    => 'fql.query',
     'query'     => $fql,
     'callback'  => ''
   );
$fqlResult   =   $facebook->api($param);

Are there other alternatives or any tips/hints you can give?

Don't forget that you need user_photos permission to access your own non-public albums, otherwise you'll just get an empty array as you're describing. Read documentation for more details

There is a super easy alternative of displaying photos from your facebook profile. It involves using an iframe code generated from facebookgalleria.com that looks something like this:

<iframe src="http://facebookgalleria.com/gallery.php?id=nike&rows=4&margin=10&cols=3&width=170&font_size=11&title_color=000&hide_next_back=0&share_buttons=1&shape=rectangle&frame=1" scrolling="no" marginheight="0" frameborder="0" width="551" style="height: 769px;" ></iframe>

This code is used for display photos from a facebook PAGE but if you want to display facebook photos from your personal profile, you have to facebookgalleria.com, connect with facebook and then generate your iframe code. The code automatically pulls new photos from your albums every 2-3 hours. Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM