In Phoca Gallery you can display images from your Facebook albums. What are the requirements to display the albums:
- Facebook account
- PHP function json_decode and cUrl enabled on your server
- If your server meets the requirements, go to Components - Phoca Gallery - Control Panel, click on Options and set Enable Facebook Image Loading parameter to Yes (it is enabled es default).
If you want to display Facebook albums (images from your Facebook albums) on your site, you need to create a Facebook Application in your Facebook account. This application is needed to communicate between your Joomla! site and your Facebook account. It will be your application so you will know, such application is secure and don't download your Facebook data into another page.
- Login to Facebook
- Go to "Create an Application" site - http://developers.facebook.com/setup/
- Add site name
- Add an URL of your site
- Select language which your site is using
- Create an application - App Name, App URL, App ID and App Secret values will be created.
- Copy App ID and App Secret value.
Example: Phoca Gallery 4.2.2, creating Facebook application, API version 2.5
- Be sure, Enable Facebook Image Loading parameter in options is set to Yes.
- Go to Components - Phoca Gallery - Facebook, click on New. Add App ID and App Secret. Click on Save button (Facebook User Settings will be displayed after you will click on Save button - so first you need to fill in App ID and App Secret, then you need to save it and then additional settings will be displayed).
- Connect with Facebook, login to your Facebook account. After successful login you will need to allow that your application can access your data. Then the page will be redirected back to the site where the parameters are listed. New button Paste Loaded Data will appear.
- Click on Paste Loaded Data button. Now parameters will be filled. Click on Save & Close.
- Go to Components - Phoca Gallery - Categories. Click on New. Navigate to bottom of the site and select Facebook User and Facebook Album.
- Click on Facebook Import button to import all images from the Facebook Album.
- Now all the images should be imported to Phoca Gallery.
Phoca Gallery and Facebook Fan Page
Images can be imported/exported from/to Facebook fan pages too. If you want import/export images from/to facebook fan page, just follow guide above, but:
- create two different accounts
- First - standard Facebook user account (see above - Components - Phoca Gallery - Facebook, click on New)
- Second - Facebook user account with added fan page information (the same like standard user account plus fan page ID). Just paste loaded data with clicking on button and change Name parameter and add Fan Page ID parameter (this ID you can find e.g. while editing your fan page on Facebook site - in URL bar of your browser), see image:
Now, you have two Facebook accounts in Phoca Gallery:
First is your standard user account, second is your fan page account - both can be used while importing or exporting images from/to Facebook (from/to user albums or fan page albums). Just switch Facebook User parameter in editing of Phoca Gallery category.
Facebook uses specific sizes for displaying images and thumbnails, for example:
- Small thumbnail: 75x x 50px
- Medium thumbnail: 130px x 87px
- Large thumbnail: 720px x 482px
If the size of thumbnail or image is different from Phoca Gallery settings, then Phoca Gallery will try to correct the size. If you will use Phoca Gallery for displaying Facebook images, it is recommended to use the same size of thumbnails for Phoca Gallery which is used in Facebook. You can set the background images to fit Facebook size. See Styling Background Images article.