Aaron Harp

Fotobook – A WordPress Plugin to Import Facebook Photos

Fotobook LogoFotobook is a WordPress plugin that will link to your Facebook account and import all of your photo albums into a page on your WordPress installation. It makes use of Facebook's API so importing your photos is a breeze.

Features

  • Interfaces with Facebook's API
  • Displays photo albums on a WordPress page
  • Import photos from mulitple Facebook accounts
  • Sidebar widgets for displaying random or recent photos & albums
  • Insert individual photos into posts/pages
  • Easy-to-use AJAX album management panel
  • Frontend validates as XHTML 1.0 Strict

Download

Demo

Check out my photo gallery.

Help Out!

To be honest, this takes up a lot of time. I enjoy doing it, but some money for it here and there would be nice.
Here are a few ways you can help out (and encourage me to work on it more =) ):

First, you could sign up for a Dreamhost account and use the promo code Fotobook. This not only helps me out but also waives the $50 setup fee when you pay monthly (only $10.95/month). If you choose one of the other payment periods you'll get $25.00 off. I've hosted with them for a couple years and I've had no problems. They have all sorts of features (500gb storage, unlimited domains, PHP4&5) and, best of all, they have one-click WordPress installs and upgrades.

Make payments with PayPal - it's fast, free and secure!If you are satisfied with your hosting and want to help out, you can send some cash over PayPal.

Installation

  1. Download and unzip the most recent version of Fotobook
  2. Upload the entire fotobook folder to /your-wordpress-install-dir/wp-content/plugins/
  3. Login to your WP Admin panel, click Plugins, and activate Fotobook
  4. Go to Options and then click the Fotobook link. Follow the two steps for linking the plugin to your Facebook account.
  5. Now import your albums on the Manage / Fotobook page.
  6. That's it!

To upgrade simply replace the old Fotobook directory with the newest version. Re-import all of your albums to complete the upgrade.

FAQ

Fotobook isn't working, what's wrong?
Before contacting me, make sure your host is running PHP 5. If not, contact their support to see if it can be changed or switch to a host that does have PHP 5.

How do I create a new style for Fotobook?
To create a new style, simply duplicate and rename one of the existing styles and modify the files.

My theme doesn't support widgets.  How do I add the Fotobook widgets manually?
Use the following template functions:

fb_photos_widget(count, mode, size)
fb_albums_widget(count, mode)

Parameters
$count: number of photos/albums to display (default: 4)
$mode: method for selecting photos/albums to display.  Can either by random or recent
$size: size of square thumbnails (default: 80)

Examples

<?php fb_photos_widget(4, 'random', 80); ?>
<?php fb_albums_widget(5, 'recent'); ?>

I have the Lightbox style selected but the images pop up in another window.
The Lightbox plugin must be installed and activated.

Can this plugin import photos from Facebook groups or pages?
Not currently.

Support

Submit any problems, questions, suggestions, or compliments through the WordPress Forums. Make sure your post has the tag "fotobook" otherwise I won't see it.  Become a fan of the Fotobook Application to be notified when updates are available.

Change History

2010.05.09 - v3.2

  • PHP 4 is no longer supported
  • Added a new Colorbox display style which works without any additional plugins
  • Fotobook plays better with other plugins using the Facebook API
  • Fixed a bug where album covers were sometimes broken
  • Fixed bug where clicking the widget thumbnails would occasionally go to the wrong photo
  • Fixed bug where the first photo would show twice in the Lightbox
  • Fixed issue when importing photos for users with more than 5,000 pictures
  • Fixed bug with inserting photos into a post/page
  • Converted all JavaScript to use jQuery instead of Prototype
  • Optimized DB structure to avoid future problems
  • Upgraded to latest version of the Facebook PHP Client (which kills support for PHP4)
  • Code cleanup and optimization

2010.01.07 - v3.1.8

  • Fixed a bug where some accounts weren't able to import albums. Props to Aaron Ibrahim for figuring this one out!

2009.10.26 - v3.1.7

  • Long photo captions are no longer truncated
  • Fixed bug which could cause some of the photos to not be imported
  • Fixed bug with Windows systems not creating the albums table. Manifested itself by acting like it imported the albums and then saying "There are no albums."

2009.02.15 - v3.1.6

  • Fixed bug where changes to album order were not saved
  • Fixed other small bugs

2008.11.20 - v3.1.5

  • Added cron script for automatically updating albums (see settings panel)
  • Readied Fotobook for WP 2.7
  • Fixed duplicate key bug when importing photos of multiple users (props Darrell)

2008.11.19 - v3.1.4

  • Fixed bug where album pages were showing 404 errors
  • Hopefully resolved some conflicts with WordBook
  • Error handling for empty albums
  • WP Ajax hook is now used for requests

2008.07.30 - v3.1.3

  • Widget can now be added manually to the sidebar.  See FAQ section
  • Added confirmation when user tries to leave manage page before applying permissions
  • Updated to latest version of Facebook platform
  • Fixed safe mode error
  • Fixed management display issue in Internet Explorer 7
  • Added debug info to the settings page

2008.07.04 - v3.1.1

  • Fixed error when user is not tagged in any photos
  • Fixed some display/formatting issues

2008.06.17 - v3.1

  • Fotobook now creates an album of photos that the user is tagged in
  • Added an option to hide albums from showing up where pages are listed in your theme
  • Password protected albums are now protected
  • Restyled the admin panels to look better with WP 2.5
  • Fixed problem with UTF8 encoding in photo captions
  • Fixed conflict with other plugins that tried to hide pages
  • Fixed wp_rewrite issue when importing albums
  • Fixed fatal exception in PHP 5 when the session key became invalid
  • Other small tweaks and fixes

2008.05.17 - v3.0.7

  • Disabled output buffering for albums because it was causing too many issues.

2008.04.29 - v3.0.6

  • Fixed fatal error on activation with some setups.

2008.04.12 - v3.0.5

  • Modified feature for inserting photos into posts to work with WP 2.5's new media library.
  • Really fixed fatal error bug when upgrading to version 3.
  • Photo gallery can now be a sub-page.
  • Improved error reporting.
  • Cleaned up the code.

2008.04.06 - v3.0.3

  • Disabled Wordbook actions when adding and deleting album pages to prevent Wordbook from re-instantiating the Facebook API class.
  • Fixed fatal 'Session key invalid or no longer valid' error when upgrading to version 3.

2008.03.20 - v3.0.2

  • Updated to the latest versions of the PHP4 & 5 Facebook API clients. Huge speed boost for photo imports with PHP5.

2008.03.20 - v3.0.1

  • Fixed bug where albums would be imported but it would still say "There are no albums."
  • Fixed issue with local scope of $table_prefix during plugin activation in WP2.5.

2008.03.15 - v3.0

  • Added support for linking to multiple Facebook accounts
  • Major improvements on the photos widget display. Thumbnails are now squares for clean display.
  • Photo widget links go to the actual photo.
  • Added module in the post/page upload iframe for inserting individual photos.
  • Ajaxified the management panel so that the user is more aware of what's going on. There is a progress bar while albums are being imported.
  • Streamlined the way that the albums are requested from Facebook resulting in far fewer requests.
  • Added "Embedded Width" option to fix overlapping problems with the embedded style on narrower themes.
  • Added stylesheet editor to options panel.
  • Removed the popup style because it's kinda old school.
  • Cleaned up the code a bit.

2007.09.03 - v2.1

  • Photos from hidden albums are no longer shown in sidebars. And hidden albums are no longer accessible by their permalink.
  • Hopefully fixed the escaped quotes problem.
  • It detects changed albums/photos a little better now.
  • Lightbox will go through all photos in an album, not just the current page.
  • Fixed the fatal error if the isterLogger class is already present on the server.
  • Sidebar thumbnails can be larger than 130px (uses full image instead of thumbnail).
  • Added "Remove All" button in the manage page to get rid of all albums and photos and start over (some people have had problems with partial imports).

2007.07.10 - v2.0.1

  • Fixed an array_slice backwards compatibility issue with pre PHP 5.0.2 servers

2007.07.09 - v2.0

  • Revamped to work with Facebook's API
  • Multiple display styles are now supported
  • Added widgets for displaying photos or albums in the sidebar
  • Got rid of all the messy cURL and regex stuff.

For version 1 info click here.

Comments (49) Trackbacks (219)
  1. Hi!
    First of all: Thank you so much for the amazing plugin. I want to use it on my WPMU installation. The site is a social projekt for german volonteers worldwide. So I would also love to translate the Plugin. But as I see, there is no ability to translate it. Right?!
    It would be great if you could add translation support.
    I also have some problems with the page, were you are able so sort the albums, because if i drag one album and want to drop it anywhere else, the album falls down to the end of the page. Hope, you can understand what I’m talking about. ;)
    Are you going to add support for other lightbox alternatives as Fancybox? That would be lovely. And last but not least whats about WP 3.0. Do you want to give support for it?

    Sorry for all these questions and requests. But I would really love to use it. ;)

    Greetings from Jerusalem

    Philipp

  2. Great idea, but, it doesn’t work! It blocks all pics throughout my entire blog!?

  3. holy cow that sucks! this is THE best gallery plugin out there. For those of us that are uploading our lives and events to facebook it is invaluable!

    I can’t stand the fact that I have to use Facebook Photo Fetcher. UGH!

    Hopefully something will spark in you and we’ll get you to mend this up soon.

    Best,
    SL

  4. For some reason, when I click on a picture, the picture opens in another window and the original webpage darkens as if it’s trying to start Lightbox. I have Lightbox 2 installed and it works fine on all my other photos. Any suggestions?

    By the way, this is an awesome widget!

  5. hi, i love this addon, though..
    its very strange, ive been installing a page on one hosting, it worked..
    then i installed the same on another hosting, and when i enable the plugin, all post contents disappear..

    can you guess where the problem is?

  6. this is weird, when i activate the plugin but with not edit the setting or add any facebook account, the images that i upload on a post dessapear
    why is thah??

  7. There aren’t any thumbnails on the main photo page that lists all my albums. Do I have to add them manually?

  8. Hi :) I installed your plugin and it works very well

    I also installed the theme you are using
    But the Trackback tab are unclickable

    Can you help me with this

  9. Hey Aaron! I’ve always found Fotobook to be one of my most recommended plugins, but there’s one feature I wish you could implement – loading the JavaScript/CSS on photo pages only. I’d imagine a lot of users out there only have a page or two on their site with photos, so performance should’ve be sacrificed across the site to load a bunch of extra files which aren’t even being used.

    Just a suggestion buddy! Keep up the great work! :-)

    • Thanks for pointing that out! The logic for including the stylesheets takes the current page into account, but not the scripts. I’ll get that fixed.

  10. Thanks for the (for me) most important wordpress plugin!

    Since the new version 3.2 I got the problem, that all the pictures in my albums are shown in random order. Or maybe not random but not the order from the facebook album. Can you fix that as well?

    • Yeah, that’s a bug in this latest version. I’ll release a fix soon, but in the meantime you can fix it by removing “ORDER BY aid” from line 269.

  11. Hey – great plugin! However, after updating to the latest version – I am getting this error (it was previously working)

    http://paradetheday.com/ptd/wp-content/plugins/fotobook/cron.php?secret=17f692e0ac7c&update

  12. Great plugin pal. My site is in maintenance mode right now so I will post a demo later. I’m using the grid-focus theme from 5thirtyone

    by the way, is there any way i can integrate the comment system so people can leave comments on individual photo?

    thank you -

  13. awesome plugin! what i wanted to do was pull in photos from my orginization’s page. I know in the FAQ you said it isn’t supported yet. Do you know when you might be able to add it to the plugin?

    Keep up the good work!

  14. Hey

    Is there a way to integrate this with a facebook application? (you’ve got: people, fanpage and application ID)?

    Thx!

  15. The compatibility with facebook page is not supported in the last versio. This is a big problem for me that i installed this plugin for get albums from my official facebook page…

    I changed the UID manually as in the previous version but i get an error back from facebook that say “Not valid session key”

  16. It would be nice if there ‘ll become a connection for fanpage and applications.

  17. What is the parameter should I put to create a page?

  18. Aaron this looks like an amazing plugin. I’m searching around for a photo plugin that allows users to comment on the photos at the photo level. Do you think you would be able to enable a option to allow comments at photo album level or photo level?

    I’d rather allow people to comment on the photos themselves instead of the album containing them. Allowing comments on both would be good too.. just needing a way to allow users to comment on the actual photos.

  19. Hey! great work, but when will you add localization support on this plugin?… becouse it’s too hard to translate o every update :/

    And keep improve and extend this is great plugin and will be better in time…

  20. Integration into a fanpage would be an awesome addition, great plugin otherwise!

  21. WOW! Best photo plugin I ever use…. thanks alot!

  22. Hi!
    Everything works fine but I have the following problem with fotobook v3.2.
    I have albums 50 photos.
    There are no problems with albums that have less than 50 photos.
    But I can not see albums containing more than 50 photos.

  23. Love the plugin! However, I noticed there is an empty table row at the bottom. Normally, I wouldn’t mind but in this particular site I’m building, it’s really messing up the layout. Is there anyway to get rid of the empty row?

  24. Howdy Aaron!

    Wohoooow! That’s really great: Working great with WP 3 and all the problems I had are solved. Thanks a lot of this great work.
    I would love to use it on my WPMU Site. But this is in German. So it would be great if you could add localisation support.

    And maybe – just for the future: Support for WPMU. So that just the Siteadmin can set up the default settings.

    A lot of greetings… ;)

    Philipp

  25. Re: Thorsten

    I’m afraid I’m having the same sort of problem only in my case Fotobook is being indescriminate in the albums its chooses to view/not view….

    Did you ever get this fixed?

    PS. Using WP 2.9.2 and Fotobook 3.2.1.

  26. @Andrew and @Thorsten:

    See this discussion: http://wordpress.org/support/topic/408642

    I’ll try to put out a fix for this soon.

    • Hi Aaron,

      Cheers for the prompt reply. Unfortunately this still doesnt fix my problem. Just to make sure I’m not doing anything obviously stupid, I have Lightbox 2 (v2.9.2) installed. Is this the correct version to use.

      Also I removed any scripts in my header file just to make sure that there werent any conflicts. Unfortunately this didnt solve anything…

      Having said all this, can I just say that this plugin is A-MAZ-ING!

      Cheers,

      Andrew

    • THX.

      That is my topic.
      But the current solution does not help.

  27. People kept bugging me about updating my modified version of your plugin which supports Pages and Groups. I’ve eventually caved in to the pressure, so here it is:
    http://tintinnabuleur.bcbc.co.uk/2010/02/15/more-fotobook-changes/

    I’d like to figure out how to get the “Added by Others” photos on a Fan Page, but alas I’ve had no joy.

  28. When I try to get new albums I have this error (I use WordPress 2.9.2)

    Fatal error: Uncaught exception \’FB_FacebookRestClientException\’ with message \’Session key invalid or no longer valid\’ in /xxxx/wp-content/plugins/fotobook/facebook-platform/facebookapi_php5_restlib.php:3003 Stack trace: #0 /xxxx/wp-content/plugins/fotobook/facebook-platform/facebookapi_php5_restlib.php(1608): FB_FacebookRestClient->call_method(\’facebook.photos…\’, Array) #1 /xxxx/wp-content/plugins/fotobook/fotobook.php(258): FB_FacebookRestClient->photos_getAlbums(\’100001110027057\’, NULL) #2 /xxxx/wp-content/plugins/fotobook/fotobook.php(664): FacebookAPI->update_albums() #3 [internal function]: fb_ajax_handler(\’\') #4 /xxxx/wp-includes/plugin.php(339): call_user_func_array(\’fb_ajax_handler\’, Array) #5 /xxxx/wp-admin/admin-ajax.php(1428): do_action(\’wp_ajax_fotoboo…\’) #6 {main} thrown in /xxxx/wp-content/plugins/fotobook/facebook-platform/facebookapi_php5_restlib.php on line 3003

    Other people have the same problem

    http://wordpress.org/support/topic/416414

  29. I just installed. I’m running WP 3.0 with PHP5. I’ve connected to FB successfully and have set all albums to be viewed by “everyone”. It says it’s successfully retrieved my albums, but then it says “there are no albums”.

  30. Aaron,

    Would it be possible to use fotobook on a non WordPress site. It is exactly the functionality I’m looking for but I don’t need a WP install…

  31. Hello!

    I installed the newest version of your plugin on my site (running 3.0) and when i got to activate it, I get this error

    Plugin could not be activated because it triggered a fatal error.
    Parse error: syntax error, unexpected ‘{’ in /nfs/c01/h12/mnt/5200/domains/thefirmgraphics.com/html/blog/wp-content/plugins/fotobook/fotobook.php on line 165

    Any help would be greatly appreciated :)

    Thanks!

  32. Any stripped down version which can be implemented into a website (that isnt wordpress)?

    im struggling to pull in the album data from facebook api, its clearly achieveable but just how is eluding me! Thanks

  33. I install the plugin 3.2 and my host ins running PHP5, but when i go and get albums ,
    Albums imported successfully.
    but there are no albums.
    i been reading and researching for 3 days and i cant find a answer to this problem!

    how do i fix that?

    • Facebook made some changes to their API that broke Fotobook (for new users). I hope to get it fixed over the weekend.

      • I hope so, I was using slickr gallery but your plugin seems to have more functionality. I’m waiting to use it and the problem of “there are no albums” could be resolved.

  34. hi there…
    Fotobook is now linked to my Facebook account. Now I need to import the albums…. but it is to no avail… anyone could help out?

    many thanks!

  35. what about our pages galleries? i mean.. if i link Fotobook with my facebook account.. is there a way to access to my pages galleries?? or i can only access to my profile images??? it’s hard/possible to code this function? (if yes which part of your code i’ve to ‘complete’?)


Leave a comment