This library / example allows you to grab all of the photos albums of a given Facebook Page / Profile and create a photo Gallery.
It's helpful if you don't want to have to create a photo upload system for a client / store and process all the photos.
It's built using Bootstrap for layout / design but it can be changed to your own liking.
Features
- Responsive Gallery
- Pagination
- Lightbox (Higher Resolution) Photo Viewing
- AJAX Loading
Set Up
Clone the repository into a new directory.
In config.txt
change $fb_page_id
to the page who's photos you wish to use.
This can be found easily.
- Visit the Facebook Page you wish to use
- Press
Ctrl+u
/Cmd + u
(Windows / Mac) - To view the page source - Press
Ctrl+f
/Cmd+f
and typepage_id
You should find something like thispage_id=131123886875208
You need the numbers only.
Next you need to create a new Facebook Developer App
- While logged into facebook, visit: Facebook Developers New Web App
- Follow the instructions to create a new FB App for your website / Web app
- For Site URL enter the site you'll be using this on (localhost works by default). Your app ID will only work on this domain
- Click 'Skip Quick Start' to go to your FB App Dashboard
- You need an
Access Token
so visit this site, that makes it easy to generate your app's access token You'll need your AppID and your App Secret, which are found on the FB App Dashboard - when you get your
Access Token
change$access_token
inconfig.txt
to this new value
Visit the directory you cloned this repo into and you should see a working gallery for the page you selected.
Settings
$albums_per_page
changes the default MAX number of albums that are downloaded in the gallery per page
$pics_per_page
changes the default MAX number of pictures that are downloaded in the gallery per page
$show_all
is boolean (TRUE / FALSE). Setting it to TRUE shows all the albums available on FB, changing it to FALSE hides Cover Photos, Timeline Photos and Profile Pictures.
Created By Darragh Mc Kay