Facebook Gallery” by “Jordie Bodlay” v1.0


“User Guide for Facebook Gallery”

Created: 14th July 2011
By: Jordie Bodlay
Email: jordie@jordie.org

Thank you for purchasing Facebook Gallery. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!


Table of Contents


Introduction - top

This user guide is intended to help you with getting familiar with the control panel and usage of Facebook Gallery. If you have not yet installed Facebook Gallery, you can view the installation guide here.

Facebook Gallery is a PHP script designed to allow you to quickly add and display a collection of albums on your website from multiple Facebook pages or user accounts.


Creating a Facebook Application - top

In order to access the albums from a user on Facebook, you must first receive their authorization. In order to get their authorization, you need to have a registered application on Facebook. The setup process is quick and very easy. However, if you do not wish to use albums from users and instead only need to add albums from pages (a business page, website page, etc.) on Facebook, there are no access restrictions and you can skip to the add a page section.

The first step is to visit https://developers.facebook.com/apps. If you have never set up an application before, you will see a screen like the following:

Click "Allow". After that, a new page will appear. Up in the top right corner, click "Create New App".

A new dialog box will appear like below. Give your application a name, perhaps "Example Gallery" where Example is the name of your website. Note, you cannot use "Facebook" in the name of your application. Choose a language and agree to the Terms of Use. After you click "Continue", there may or may not be a captcha image you must fill out.

If your Facebook account has not been "verified" by Facebook, it will require you to verify it at this point. This involves entering your mobile phone number or inserting a credit card number. Once you've verified, or if you didn't need to, you will be shown the page for your new application.

Now you must specify what website you are going to put your application on. Click on 'Web' on the left side menu.

Now you must enter your website URL and domain name in the fields, like the example in the image. In this case, Facebook Gallery may actually be installed at http://www.example.com/fbgallery/, only http://www.example.com/ needs to be used for the "Site URL" and only www.example.com or example.com for the "Site Domain". Click "Save Changes".

After saving, you will be notified the change was successful. On this page, or on the About page, you will notice "App ID" and "App Secret". (See image above, though the values have been blurred out)

You now need to login to your Facebook Gallery control panel, and click on the 'Settings' in the top right of your control panel. There will be two fields here, "App Id" and "App Secret". Copy and paste these two values from the application page on Facebook to the fields in the Facebook Gallery dialog:

Click "Save Settings". The App Id and App Secret will be saved and the control panel page will refresh.

Congratulations! Your Facebook application is now set up and ready to add users!


Authorizing a User - top

Facebook has privacy security on user accounts and you can not simply download albums from any user. You must get authorization from that user in order to access their (or your) album information.

To authorize and add a user to Facebook Gallery, click the 'Authorize a User' button in the control panel.

A dialog window will now appear asking you to login to Facebook (in another tab/window) as the user you wish to get authorization from. Once you've confirmed that you've logged in as the correct user, click the "Continue" button.

You will be redirected to a page on Facebook itself to confirm authorization. Click "Allow".

You will be redirected back to the control panel, and the user will have been added to your control panel.

You have now successfully added your first user! You can now add a album using this user.

Add a Page - top

To add a Facebook page, click on the "Add a Page" button in the control panel.

A dialog window will appear. Paste the URL of the page you want to add into the text box.

Pages that have specified a username will have a shorter URL, such as:

http://www.facebook.com/cocacola

Pages without a username will have a longer URL, which includes /pages/, the page name and most importantly the page ID number, such as:

http://www.facebook.com/pages/Apples/1124458773

Either format is acceptable, as long as the whole URL is entered.

Click the "Continue" button.

If the URL was a valid Facebook page, you will see a success message and the page will be added to the list on the left.

You have now successfully added your first page! You can now add a album from this page.


Deleting a User or Page - top

In order to delete a user or page, hover over the name of the user or page in the list on the left of the control panel. When hovered over, an X will appear to the right. Click this X and a confirmation window will appear.

Take note of the message, where all albums that were added using this user will also be deleted.

When you are sure you wish to delete this user or page, click the "OK" button.

If successful, you will see a message like the one above and the user or page and its albums will have been removed from the application.


Add an Album - top

To add an album, click on the button labelled "Add an Album" in your control panel.

A dialog window will then appear where you can select amongst your users and pages. Select the user or page you wish to add album from, and click "Continue".

The next dialog window will now display all accessible albums for this user or page. Click on the albums that you wish to import into Facebook Gallery. You can select as many as you wish. Then click "Use Selected Albums".

The albums will now be downloaded and imported into Facebook Gallery. You will be shown the progress of this import. It may take a few minutes per album, depending on your server's internet connection.

Do not close the window or tab, otherwise the albums will not be imported correctly or completely.

Once the importing has finished, you will see a success message and the albums will appear in the album list on the right of your control panel.

Congratulations! You have added your first albums. You can click on the "View Gallery" link in the top right of the control panel to view the albums.


Delete an Album - top

In order to delete an album, hover over the album in the list of albums on the right of the control panel. When hovered over, an X will appear to the right. Click this X and a confirmation window will appear.

When you are sure you wish to delete this album, click the "OK" button.

If successful, you will see a message like the one above and the album will have been removed from the application.


Sorting Albums - top

In order to change the order of albums, simply hover over the album you'd like to have change position, click and hold, then drag the album up or down in the list of albums. Once it is where you want it to be, let go of the mouse button and the order of albums will be saved in this new order.


Verify Users - top

If a user changes their password, or some other privacy setting, Facebook may automatically de-authorize any application. It may also occur for other reasons. To check if this has happened, click the button "Verify Users" above the user list. All the users will then be checked to see if they are correctly authorized. (Note: Pages need no authorization and will not be checked.)

If a user is found de-authorized, a yellow exclamation mark will appear to the right on the user's name. Click this exclamation mark to re-authorize the user.

The steps from here are the same as the original authorization process.


Refresh Albums - top

Facebook Gallery downloads your selected albums from Facebook to your website. Due to this process, if you make a change to an album on Facebook, the changes are not reflected by this script. There are two ways this can be fixed. In the control panel, above the list of albums there is a button "Refresh Albums". Clicking this will check all the albums against Facebook and download any new or updated photos. This process can also be automated through Cron.

Click the "Refresh Albums" button to check all the albums against Facebook for any updates or changes.

A progress screen will appear showing which albums are currently being updated.

When the process is finished, you will be shown a success message.

If you wish to only update one album, you can do this by hovering over the album in the control panel and toward the right, next to the delete X is an icon to refresh just that album. Click that icon and the album will be updated with any changes.

A progress screen will appear showing the status of updating the album. When the process is finished, you will be shown a success message.


Setting up Cron - top

Facebook Gallery downloads your selected albums from Facebook to your website. Due to this process, if you make a change to an album on Facebook, the changes are not reflected by this script. There are two ways this can be fixed. In the control panel, above the list of albums there is a button "Refresh Albums". Clicking this will check all the albums against Facebook and download any new or updated photos. This process can also be automated through Cron.

Cron is a server-side job scheduler. That means we can tell it to refresh the albums every few hours, to ensure any changes made on Facebook are reflected on your website no more than a few hours later. Cron is only available on Unix-based servers.

Usually your web host will have a method in your hosting control panel to set up cron. If you're unsure how to do it, your host should have a FAQ/Knowledgebase entry that will guide you through the steps. What you need from this script to set it up is the command. Cron needs a command and a time frequency to run that command (e.g. run Facebook Gallery every 4 hours). Click here for a guide on setting Cron up using cPanel. cPanel is a common control panel interface that your web host might use. If they don't, you'll need to contact them for instructions.

The command you want Cron to run will execute a PHP script. Here is an example that you might put into the cPanel interface:

/usr/local/bin/php /full/path/to/fbgallery/admin/cron.php

The first path is the path to PHP on your server. This may differ depending on your host. You may need to contact your host to find the correct path. The second path is to the admin/cron.php script in Facebook Gallery. Make sure you replace /full/path/to/fbgallery/admin with the correct full path to where the Facebook Gallery Admin script resides on your server (Note: this is the path on your server, NOT the URL that you may use in a web browser).

Click on "Script Info" in the top right of the Facebook Gallery control panel to find your full-path for the cron script.


Settings Explained - top

In your control panel, up in the top right hand corner there is a link to a Settings dialog.

Clicking on this link brings up a dialog like the following.

There are three fields, Application Id, Application Secret and View Gallery URL. The Application Id and Secret are explained and used when creating a Facebook Application.

The third field "View Gallery URL" allows you to change the web address used for the "View Gallery" link in the top right of your control panel (right near where you just clicked "Settings" to view this dialog).

By default it links to the default page for the gallery, however if you have included the gallery into Wordpress or another PHP application, you can change this field to the URL where your Gallery is displayed. If you are entering a full URL instead of a path, make sure it begins with "http". If it starts with just "www.", the link will not work.


Editing the Control Panel Login - top

When you first installed Facebook Gallery, you selected a username and password. If you wish to change this username and password, you can do this from the control panel by clicking the 'User Options' link in the top right of the control panel.

A dialog window will then appear and give you the option to change your username and/or password.

If you only want to change your username, then do NOT fill in any password field. If you wish to change your password, you must enter your current password, then your new password and then the new password a second time to confirm you typed it correctly.

Click "Save Changes", then the next time you login you'll need to use the new username and/or password.


Once you have added some albums, you may want to see your Gallery! The Gallery can be viewed by clicking on the "View Gallery" link in the top right of the control panel.

This will show you the default gallery view. You may also include the gallery into your PHP website, using the instructions in the installation guide.

If you have your gallery displayed on another page on your website through PHP includes, you can change the page the "View Gallery" link links to through the settings dialog.



The End
If you require any help at all, please feel free to email via my user page contact form here

Jordie Bodlay

Go To Table of Contents