The idea was inspired by Fotobook, though its approach is fundamentally different: while Fotobook's emphasis is on automation, this plugin allows a great deal more customization. With it you can create galleries in any Post or Page you like, right alongside your regular content. You do this simply by putting a "magic HTML tag" in the post's content - much like Wordpress Shortcode. Upon saving, the tag will automatically be populated with the Facebook album content. Presentation is fully customizable via parameters to the "magic tag" - you can choose to show only a subset of an album's photos, change the number of photos per column, show photo captions, and more.
Also, Facebook Photo Fetcher does not limit you to just your own Facebook albums: you can create galleries from any album you can access, including groups and fanpages. This is very handy if you're not the main photo-poster in your social circle: just let your friend or family upload all those wedding pics, then import them directly to your blog!
Features:
- Uses Facebook's API to instantly create Wordpress photo galleries from Facebook albums.
- Galleries are fully customizable: you can import complete albums, select excerpts, random excerpts, album descriptions, photo captions, and more.
- Galleries can be organized however you like: in any post or page, alone or alongside your other content.
- Simple PHP template function allows programmers to manually embed albums in any template or widget.
- Galleries can be created from any album you can access: yours, friends', groups', or fanpages'.
- Built-in support for automatically attaching Post Thumbnails to any post or page that includes a gallery.
- Built-in lightbox: Photos appear in attractive pop-up overlays without the need for any other plugins.
- Admin panel handles all setup for you: Just click Connect, login, and you're ready to start making albums.
- Admin panel includes utility to search for all albums you can access (and use to create galleries).
- Admin panel includes utility to auto-traverse your galleries, updating those that've changed on Facebook.
- No custom database modifications: all it does is automate the creation of post/page content for you.
Demo
The following box contains a sample gallery imported from Facebook using this plugin. It's generated by one single "HTML magic tag" placed in the content of this page:
From Petrified Petra, posted by PederY on 6/13/2009 (Showing 16 of 60 items)
"Justin and I returned to the hotel after our late night at Petra. We decided to start bright and early the next day and get moving before the sun came up. Ladden with water, cameras and kebabs we ventured into one of the most amazing ancient cities on earth. And it would truly be a day to remember."
Generated by Facebook Photo Fetcher
"Justin and I returned to the hotel after our late night at Petra. We decided to start bright and early the next day and get moving before the sun came up. Ladden with water, cameras and kebabs we ventured into one of the most amazing ancient cities on earth. And it would truly be a day to remember."
- We started down the same path we had walked mere hours before. Some structures had be...
- A few meters down the main path we had to venture into the narrow opening between the...
- We had left the hotel way before the sun came up and were one of the first people in ...
- Almost as enchanting as the day before, and almost equally surprising, was the feelin...
- There was a neverending line of camels and donkeys and bedouins and carts with touris...
- The obligatory "me in front of Petra"-picture. The sun was still hours away from reac...
- The Treasury (or Al Khazneh) is simply amazing workmanship, thousands of years old. I...
- Petra has also been the stage for numerous movies, like Indiana Jones (which we were ...
- Camels look smart!
- Almost unbelievable that it's so intact.
- As we were leaving, tourists started pouring in from the opening in the mountain behi...
- Leaving the Treasury, we continued down the Street of Facades. Here it seemed like th...
- Camels with bedouins (or vice versa) constantly reminded us that we were far far from...
- We had done our homework and quickly left the beaten path. Our second destination was...
- In this picture it was supposed to look like we were supporting ourselves from fallin...
- Finally at the top! I bet this picture could have been used as an advertisement for s...
Instructions
- Download the latest version from here, unzip it, and upload the extracted files to your plugins directory.
- Activate the plugin via your Wordpress admin panel.
- Head over to Settings -> FB Photo Fetcher.
- Click the "Login to Facebook" button to popup a Facebook login page. Enter your information, click "Login", then close the popup. Next, click "Grant Photo Permissions." Accept the permissions in the popup and when it says "Success," close it. Finally, click "Save Facebook Session." It should now say This plugin is successfully connected with xxxxxxx's Facebook account.
- Now we need to get the ID of an album you'd like to import. Click the "Search for Albums" button; It will automatically connect to Facebook and produce a list of all the albums you can access, each with an associated ID number. Let's use the example 1234567890123456789.
- Create a new post or page and enter the following tags, replacing
the example ID with the one you'd like import. Note that you must use
the HTML Editor (not Visual Editor) for the tags to be recognized:
<!--FBGallery 1234567890123456789 --><!--/FBGallery--> - Click "Save", and you're done! You can now view your new album.
Customizing
Magic Tag Parameters
Let's start off with the basic code for importing a Facebook album into a page or post:
<!--FBGallery 1234567890123456789 --><!--/FBGallery-->
If you want a bit more control over how this presents the album, there are a number of parameters you can add to the opening tag, after the album ID number. These are:
- cols=#: Set the number of photos to show per row (default is 4).
- start=#: Start showing photos from the given index (i.e. to skip the first 2 photos, enter start=3)
- max=#: Limit the number of photos (i.e. to only show the first 5 photos in an album, enter max=5)
- rand=#: Show a random selection of photos from the album. This is applied after start & max, so to show 5 random photos from the entire album, enter rand=5; to randomize the first 5 items in the album, enter start=0 max=5 rand=5 (first limit the photos to the first 5, then randomize them).
- orderby=reverse: Flip the order of photos in the album (i.e. to show only the latest, you'd use "orderby=reverse max=1")
- hideHead=1: By default, albums will display their author, item count, and description prior to the first photo. Setting this will omit it that information.
- swapHead=1: Swap the order of the information in the header - author first, description second.
- hideCaps=1: By default, each photo shows an excerpt of its caption below it. Set this to omit them.
- noLB=1: By default, this plugin outputs the JS needed to setup the lightbox popups. Set this to omit it.
<!--FBGallery 1234567890123456789 cols=4 max=16 swapHead=1 --><!--/FBGallery-->
Groups & Fanpages
Thus far, we've only discussed importing personal photo albums. If you'd like to import photos from a group or fanpage, you'll need to include one more parameter with the magic tag:
- To show photos from a GROUP, add the parameter isGroup=1 and replace the albumID with a groupID.
- To show photos from a FAN PAGE, add the parameter isPage=1 and replace the albumID with the pageID. At the moment you can't specify individual albums within fanpages; it will just pull all photos from all albums on the page. You can then limit what's shown by using the "start" and "max" parameters described above.
<!--FBGallery 10150100736095176 isPage=1 rand=10 --><!--/FBGallery-->
Albums from PHP
If you've got a custom template or widget in which you'd like to include a gallery, you can call the function fpf_fetch_album_content() directly. It accepts the same parameters as the HTML tags above; for example:
$album = fpf_fetch_album_content( '123456789', array('cols'=>6, 'max'=>18) ); echo $album['content']; echo "Thumbnail: " . $album['thumb'] . ", Photo Count: " . $album['count'];
Post Thumbnails
This plugin supports automatic Wordpress Post Thumbnails. If you download and install the Add From Server plugin and set a thumbnail path in this plugin's Settings page, it will copy each album's thumbnail to your local server and attach it whenever you create or update a gallery.
Item Counts
Whenever a Facebook album is inserted into a post, that post will be given the postmeta "_fb_album_size", containing the number of shown items in the album. You can reference this from your code if you wish.