Bubble Action Gallery
This will be some instructions for the foe campaign tool, and maybe a link to download the script if I can get the license sorted.
You can always email or phone if you have any questions though.
Stephen.
Requirements
PHP compilied with GD image library (with jpeg support) and with freeType support.MySQL
PHP enabled web server
We've had it running on Linux and Windows under PHP4 and PHP5.
Installation
Setting up the gallery is pretty straightforward. Essentially there's three steps you need to do:1. Setup MYSQL database
2. Change configuration settings.
3. Upload files and set folder permissions.
1. Setup MySQL Database.
Create a database, you can either use a comand prompt, or use phpMyAdmin, or whatever method you're most used too.
An empty(ish) database schema is provided in the sql directory. You can use this to create the tables required. If you're using phpMyAdmin then
2. Change configuration settings
The config settings are in includes/global.php
The only things you need to change are the database connection settings:
/* testlab server*/
$host_db = "localhost"; // the name of the db host..
$user_db = "aPretendUser"; // the name of the db user we're going to connect with.
$pass_db = "aPretendPassword"; // and their password.
$name_db = "the_database_name"; // the name of the database to select.
You can also change the maximum and minimum sizes of the picture that is created when the picture is uploaded and the message bubble added by changing:
$mainImageMaxWidth
$mainImageMaxHeight
and
$mainImageMinWidth
$mainImageMinHeight
This will affect the size of the picture in the add message page (select.php). The size of the main picture and thumbnails in the gallery can be set in image.php
The max file upload size can be set by changing the value of $maxFileSize
The file size is specfied in bytes.
If you wish to keep the original photos that the user uploads without them being processed then you can set the $keepOriginals flag to 1. This will make a copy of the file uploaded (without the bubble) in the originals folder. You need to make sure the originals folder has write permissions (see below). Remember of course that saving extra copies of the photos will significantly increase the space required on the server.
3. Upload files and set folder permissions.
Upload all the files and folders to your webserver.
The photos folder needs to be CHMOD 777 - this is where the uploaded images are stored.
The moderator folder should be protected using .htaccess
The approved folder and the originals folder also need to be CHMOD 777 if you're planning on exporting the approved pictures or keeping the original pictures that were uploaded.
Localization
The language files are stored in the lang directory.You can simply copy one of the current files to translate. They take the form of a php array, so if you open the file in a text editor you'll see things like:
'homePageTitle' => 'Enter hompage title here',
'homePageHeading1' => 'Homepage heading.',
The entries on the left of the => are the refences we use, so don't fiddle with those.
The text to the right of the => is the text to translate.
Remember that it's a php file, so you'll need to escape single quote marks.
Sooo....
'homePageTitle' => 'FOE's homepage',
will confuse things but
'homePageTitle' => 'FOE\'s homepage',
will work a treat.
Be careful with line breaks as well. If you need a break in a line of text use an html <br/>, entering carriage returns in the text will upset things.
To use a specific language file you need to link to the gallery using a lang='whatever' variable.
For example, to specify a french language file on the testlab server, use:
http://testlab.org.uk/foe/foeGallery/index.php?lang=fr_FR
That tells the tool to look for the fr_FR.php language file that you've saved in the lang directory. If it can't find it then it will default back to English.
The language choice is then stored for as a session variable so all the other pages will be in the selected language.
You can create as many translation files as you like.
If you want to provide the users with a choice of languages, then you can just provide links or a form select that points them to index.php?lang=fr_FR or index.php?lang=nl_NL or whatever you fancy.
Administration
The admin interface is in the moderator directory. You really should have password protected this.- Approved Pictures
The first page of the admin interface is the list of photos that have been approved. From here you can update names, email addresses and countries, and you can change the status to unapproved. - Unapproved Pictures
Unapproved pictures lists the er, well the unapproved pictures. You can change as above but you can also delete pictures - be careful though, once they've been deleted they're gone for good. - Default Pictures
The default pictures for the initial gallery page and the thumbnails on the homepage.
You'll need to know the id of the picture you want to use. You can get these either by trawling through the admin interface or use the gallery to browse to the picture you want and make a note of the p= variable in the URL. eg. gallery.php?page=2&p=179&country= shows the picture with an ID of 179.
Clicking on preview will update the pictures on the page, but changes aren't saved until you click on the save changes button. - Copy pictures
Click on this link if you want to separate out the approved photos from the unapproved ones. You'll need to have created a directory on the server called approved at the same level as the photos directory and with the same permissions (777). Opening this page will make a copy of all the approved photos. - Help
Hey, you probably clicked on this link to get here so you know what it does.
If you're reading this in the readme though then there may be some updated info at
http://www.millipedia.co.uk/bubbleActionGallery.html
Not strictly a moderator thing, but you may also want to tidy up photos and originals folders from time to time. If a user uploads a picture but doesn't complete the message then you may be left with a temporary file in the photos folder. These files get named using the users session id, so they'll be the ones named something like d6d2ec5a7962258479bae522be8aa6db.jpg rather than something like 23.jpg. Of course if the site is live and active then some of those files might actually be being used, but anything older than an hour or so is probably fair game for being deleted.
Notes
The gallery obviously uses a fair amount of javascript and is really only designed to run on Mozilla and IE5.5 and above. However, even with an older browser or with JS turned off it is still possible to use the tool but not always to position the bubble or change the default message.We've tried very hard to make it as accessible as a photo based tool can realistically expect to be. Everything should validate as valid XTML and valid CSS. Old browsers and non-javascript browsers should fail reasonably gracefully.
Credits
The original gallery script was written by a South American company for another FoE campaign. There's actually very little of their code left (their tool was mainly Flash based). If I can get their permission or if I clear all their code out then we'll probably open up the source. But props to them for the original development anyway.The drag features of the tool use the scriptaculous implementation of the prototype javascript library.
Everything else was coded and is copyright by us, so there.
04-Sep-09 12:38:11