How to . . .

Add an Album
============

To create a new Album, you need to decide on a name for it and create a folder with that name. Use underscores instead of spaces and avoid other punctuation apart from hyphen. Build it offline in local storage to begin with.

CREATE FOLDERS
Inside this Album folder create four two-letter-name directories/sub-folders called: 'ca', 'me', 'or' and 'sm'.


CREATING THE IMAGE FILES
Copies of your original photographs go in 'or'.

Create a version of each of those pictures in 'or' so it would fit an 800x800 box and place them all in 'me' with the same name as those in 'or'.

Similarly, Create a version of each of those picture which would fit an 320x320 box and place them all in 'sm' retaining the same filename.

Choose one representative photo from the album and create a thumbnail measuring 240x180 pixels. Name it badge.jpg and place it in the Album alongside the four directories.

Lastly, for each image, create the caption text files. For each photo there must be a caption file in 'ca', usually containing the root filename but even if blank for no caption. This can be done manually - use the same root filename: name.jpg should have a caption file name.txt -  but there is a quicker way if you are adding a large Album and creating all those text files is daunting.

CREATING CAPTION FILES IN BULK
Once the Album folder and its badge, and its three images for each photo in their two-letter folders are ready, upload the Album with an empty 'ca' subfolder via your FTP client to where you want it.

It must be in one of the folders which represents a collection of Albums, i.e. in one of these:
B7E4A7B3O8A0C/
B7E4A7B3O8A0C/Miscellaneous/
B7E4A7B3O8A0C/Miscellaneous/Training_and_Annual_Refresher/       or
B7E4A7B3O8A0C/Uniforms/

Now using your FTP program, copy the file
B7E4A7B3O8A0C/_tools/write-caption-files.php
into your new Album, alongside the badge and two-letter folders.

Open your browser and type the address of that new file into the URL bar, i.e.:
B7E4A7B3O8A0C/[name of your new Album]/write-caption-files.php
if it's in the main folder.

After a few moments it will say 'Done' and will have created the caption files and written the filenames into the files. If you run it again (don't!) it will write the captions again and they will be in every file twice. If you make a mistake, delete the caption files and try again.

ADDING AN ALBUM TO A COLLECTION
Having placed your Album folder in the right place with its four folders each with the same number of appropriate files and a badge, you now need to add it to the collection so it knows about it. You need to make a small edit to one file.

If your Album is in 'B7E4A7B3O8A0C/' you need to load the file 'albums.php' into a TEXT editor (Notepad will do, Word or suchlike is more likely to screw it all up).

If your Album is in one of the other collections, you need to edit the file index.php located there.

Looking at albums.php or a collection's index.php file there are a number of variables you can alter, including one whose first line is "$sections = array(" where you will see the names of the other folders already in this collection.

All you have to do is add the name of your folder in the same manner as the others. The order of display of a collections of Albums is determined here and will work if you add yours anywhere and maintain the correct punctuation.

i.e.
"Folder_name",
unless it's the last one
"Folder_name");

Now save the file back to the web site via FTP and it should work right away.

If it doesn't...

Errors
------
If when you visit the Album the page says "The Pix directories do not contain the same number of files." then something has gone wrong. The folders 'ca', 'sm', 'me', and 'or' must contain the same number of files. They don't have to have identical names but there must be the same number of files in each folder. There is an assumed correspondence between the first file in each folder, the second, the third and so on to the last when they are sorted alphabetically. If you identify a missing or extra file somewhere, take great care to add/remove the correct one.