Saturday, November 26, 2011

What Is Facebook Photo Fetcher?

Facebook Photo Fetcher is a Wordpress plugin that allows you to quickly and easily generate Wordpress photo galleries from any Facebook album you can access.

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.
To get started, check out the Instructions section below.


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


Instructions


  1. Download the latest version from here, unzip it, and upload the extracted files to your plugins directory.
  2. Activate the plugin via your Wordpress admin panel.
  3. Head over to Settings -> FB Photo Fetcher.
  4. 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.
  5. 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.
  6. 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-->
  7. Click "Save", and you're done! You can now view your new album.
Ways to customize the album's behavior (including Group and Fanpage support) are listed in the next section.


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.
As an example, the demo gallery above was created with the following tag:
<!--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.
For example, if you wanted to create a gallery that randomly selects 10 photos from my fanpage, you'd use:
<!--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.

No comments:

Post a Comment