Introduction
Somewhen I played a little with SimpleViewer, which is a cool, slick, free and customizable Flash image viewing application, created by Felix Turner of Airtight Interactive. After having a nice little play I decided to develop SimpleViewerAdmin, which implements the corresponding administration interface. But SimpleViewerAdmin can do even more for you. Not only do I have implemented a complete and feature-rich administration interface, SimpleViewerAdmin extends SimpleViewer by offering you the opportunity to run the gallery with multiple albums. SimpleViewerAdmin was completely written in PHP, and makes use of the GD library functions and the SAX library functions, so both of these extensions are very recommended (see Requirements).
If you have any questions, hints or suggestions concerning the documentation or the code and its usage, please feel free to use the forum. Please make sure you have read and understood the license.
Download
The current stable and recommended version is 1.3. Please refer to the ChangeLog to find out what's new, fixed or is just working better than before.
  • SimpleViewerAdmin-1.3.zip (approximate file size: 33kB), see Upgrade instructions.
  • SimpleViewerAdmin-1.2.tar.gz (approximate file size: 18kB)
  • SimpleViewerAdmin-1.2.zip (approximate file size: 23kB)
  • SimpleViewerAdmin-1.1.tar.gz (approximate file size: 17kB)
  • SimpleViewerAdmin-1.1.zip (approximate file size: 23kB)
  • SimpleViewerAdmin-1.0.tar.gz (approximate file size: 16kB)
  • SimpleViewerAdmin-1.0.zip (approximate file size: 21kB)
Upgrade

(0) The upgrade procedure became necessary to do two important tasks when upgrading from a previous version of SimpleViewerAdmin. First, the gallery configuration ( SimpleViewerConfig.xml ) has to be converted, since new attributes became available. And second, all imageData.xml files of all albums have to be converted, since new attributes became available, too. So, both of these tasks are to be accomplished, when you follow the next few steps...

(1) Backup necessary!
First of all, backup your complete installation folder, just in case...

(2) Then copy SimpleViewerConfig.xml to SimpleViewerConfig.xml.bak , then copy everything from the extracted archive to your installation folder. Make sure that the directory permissions are still set properly. Afterwards your installation directory should look like the default directory layout, plus your album folders, if you have already created any.

(3) So far, so good. Make sure that all files and folders still are readable and writable by the world ( "chmod -R 777 your_installation_dir/" ). Now fire up your browser and open http://yourdomain/installation_folder/upgrade.php , click the button and hope that everything works out fine. You'll get messages about the status of the upgrade.

(4) After that go to http://yourdomain/installation_folder/SimpleViewerAdmin.php and check that your login still works, if so, good. If not, the upgrade didn't work out as expected. Log in with the default username/password-combination ("admin/admin"), go to "Edit gallery configuration" and change all settings as you set them before. After that you could delete the old SimpleViewerConfig.xml.bak . After that log out and log in again to test that all your changes have been applied. If that works, part one of the upgrade is finished. Next step...

(5) Once you're logged in, you should now see all your albums in the menu as "Published". If so, everything is fine. If not, the second task of the upgrade has failed, too. In this case you'll have more "handy" work to do.

(6) Open your FTP application and download all imageData.xml files from all your albums. But beware, although they all have the same name, each one of those is unique, as you probably have uploaded different images to different albums.

(7) Once the files are on your harddrive, open them in your text editor and add the attribute isPublished="true" to the opening <SIMPLEVIEWER_DATA> -tag (that's where all the other attributes are listed). Save the files and upload them to the album folder from which you got them. Now login again and check the status of your albums, all should now be listed as "Published".

(8) Once you got this far, and everything worked out fine in the end, you should delete the files upgrade.php and SimpleViewerConfig.xml.bak , if they still exist in your installation directory.

Documentation
Acknowledgements

The documentation provides an insight on your SimpleViewer/ SimpleViewerAdmin installation. The administration interface gives you all the functionality you need at hand. The following list provides an rather incomplete overview of the main features currently implemented:

  • Configure title, colors and the login data of your gallery.
  • Configure the layout of your albums.
  • Manage your albums:
    • Either create, edit or delete your albums.
    • Upload, edit and delete your images.
    • Publish and unpublish your albums.

You will always find the latest version of this document here.

Requirements

There are several different requirements that are mandatory to be satisfied, on the client side and on the server side.

Client Server
  • XHTML 1.0
  • CSS 2.1
  • Javascript 1.3
  • Flash 6 PlugIn
  • Cookies
  • Supported Platforms: Linux, UNIX, Mac OS X
  • PHP4.1 and above, PHP 5.0.4 and above
    • GD (1.x works, 2.x recommended)
    • XML support (expat, libxml)
    • Safe-Mode has to be Off.
  • Write access to the installation directory is mandatory.
Installation

Which mode to run?

Your SimpleViewer gallery comes in two different flavours. It's up to you to decide, if you want to run SimpleViewer either in static or dynamic mode. The dynamic mode is of course the most comfortable version you can choose. SimpleViewer in static mode can be run on all hosts, because there are no requirements to the server. If you decide to run the dynamic mode you will be able to enjoy all the features SimpleViewer and its included administration interface has to offer.

If you decide to run SimpleViewer in static mode, your installation directory content will probably look like this (that's pretty much the same when you downloaded SimpleViewer from its website):

+ SimpleViewer/ | - flash_detect.js | - get_flash_player.gif | - imageData.xml | + images/ | - index.html | + thumbs/ | - upgrade.html | - viewer.swf

If you wish to run SimpleViewer in dynamic mode, your installation directory content should look like this (that's how it looks after you've extracted the contents of the SimpleViewerAdmin archive into the same directory):

+ SimpleViewer/ | - SimpleViewer.php | - SimpleViewerAdmin.php | - SimpleViewerConfig.php | - SimpleViewerConfig.xml | - SimpleViewerCss.php | - SimpleViewerEditImage.php | - SimpleViewerFunctions.php | - SimpleViewerImageData.php | - flash_detect.js | - get_flash_player.gif | + img/ | - ArrowLeft.gif | - ArrowRight.gif | - Delete.gif | - Edit.gif | - index.php | - upgrade.html | - upgrade.php | - viewer.swf

First steps in dynamic mode (using SimpleViewerAdmin)

  • First and foremost, you should set the proper rights. You need to execute a "chmod -R 777 your_installation_dir/" to make the directory writable, you're running in. But you do not need to have shell (ssh) access on your server, you can use any FTP program (like WS_FTP) that supports FTP commands to set the directory properties accordingly.
  • Login (default username/password combination is "admin/admin") and configure your gallery. The first thing you should do is change the default username/password combination to something that finds your pleasure.
  • After that you're ready to add an album and can start uploading your images. The SimpleViewerAdmin provides a simple and clean interface to upload, edit and delete your images. For each image you upload, you can specify a short caption text (max. 255 characters).
Frequently Asked Questions (FAQ)
When to enable emergency mode?
I added the emergency mode to give the user the possibility to troubleshoot his gallery all by himself. The emergency mode is meant to be enabled when, and only when you run into real problems. But be aware that you could either use it to save your day, or to dump it. The emergency mode gives you a list of several PHP environments variables and system settings that might be useful to track down an error. And it features a form to delete album directories (in its entirety), in case something severly bad happened to it, e.g. the imageData.xml-file contains error or unallowed characters, and can't be recovered. Then use this form and delete the album folder in question, and you'd be able to run your gallery just like before.
How to enable/disable emergency mode?
Once a situation occurs, you wish you hadn't done that last action, the emergency mode could save your day. To enable it, you only need to do three little steps.
1. Download the SimpleViewerConfig.xml-file via FTP.
2. Open it in your default text editor, watch out for an attribute called "emergency" , and change its value to "true" .
3. Upload the file via FTP to the location from where you got it and open http://yourdomain/installation_folder/SimpleViewerAdmin.php in your browser.
To quit the emergency mode, just take the same steps as above, except changing the emergency-attribute's value to "false" . That's it.
The parameters (and their acceptable values) within "Edit gallery configuration".

adminUsername : Any string of text you like; 8 characters max.
adminPassword : Any string of text you like; 8 characters max.
title : Any string of text you like; no markup supported.
welcomeText : Any string of text you like; no markup supported.
extraText : Any string of text you like; no markup supported.
showThumbnailsOnIndex : Either True or False .
backgroundColor : Any hexadecimal value in the range of 0x000000 and 0xFFFFFF .
foregroundColor : Any hexadecimal value in the range of 0x000000 and 0xFFFFFF .
The parameters (and their acceptable values) within "Edit album configuration".

maxImageDimension : Largest height or width of your largest image (in pixels).
textColor : Any hexadecimal value in the range of 0x000000 and 0xFFFFFF .
frameColor : Any hexadecimal value in the range of 0x000000 and 0xFFFFFF .
backgroundColor : Any hexadecimal value in the range of 0x000000 and 0xFFFFFF .
frameWidth : Width of image frame in pixels.
stagePadding : Distance between image and thumbnails in pixels.
thumbnailColumns : Number of columns of thumbnails.
thumbnailRows : Number of rows of thumbnails.
navPosition : Either top, right, bottom or left.
navDirection : Either LTR (Left-To-Right) or RTL (Right-To-Left).
isPublished : Either True or False .
title : Any string of text you like; no markup supported.
Further information on how to customize SimpleViewer is available over at Airtight Interactive.
ChangeLog
Version 1.3 (2005-07-15)
Feature/Bugfix release: Besides some minor fixes, this release includes several major enhancements. The interface got some polishing, and new features were added. Upgrading to this release from a previous one should work seemslessly by simply overwriting all files (expcept your albums, of course) in the installation directory.
  • [NEW] More options to customize your gallery: The fields welcomeText and extraText have been added. The title for the gallery is now optional (as are welcomeText and extraText).
  • [NEW] Added the opportunity to publish/unpublish an album.
  • [NEW] Added/Enhanced the emergency mode (former debug mode), which provides lots of helpful information and a worst-case album deletion form.
  • [NEW] Added markup support to the image captions.
  • [NEW] Implemented upgrade.php to make the switch from an older version more convenient.
  • [NEW] Polished the interface to make it look slicker and act more smoothly.
  • [NEW] Added the opportunity to choose whether to display the album overview as a simple list (modified) or as a nicely marked up table sporting a random thumbnail from the respective album.
  • [FIXED] UTF-8 support is now finally fixed/enabled/enhanced (hopefully).
  • Added/modified several functions and logic, mainly core work.
Version 1.2 (2004-06-19)
Feature/Bugfix release: Besides two small fixes mostly mentionable is the freshly implemented ImageConverter, which enables users to upload images of different file types, without the need to convert them manually before upload. Beyond that users are informed which file types are supported by their servers.
  • [NEW] Images within albums are properly sortable now.
  • [NEW] Added switch to enable debug mode in AdminInterface. Useful for installation purposes.
  • [NEW] Implementation of an ImageConverter. That's a kinda neat feature. Users are now able to upload .gif, .jpg and .png images, only depending on their server configuration, i.e. PHP's GD support for the different image file types. Please refer to the documentation for further information.
  • [FIXED] IE/Win: Sending false Content-Type headers on image upload. Although the filetype is image/jpeg , Internet Explorer sends image/pjpeg anyways. The addItem() function was modified to properly handle the ImageConverter.
  • [FIXED] Albums are now sorted properly, namely alphabetically.
Version 1.1 (2004-05-29)
Bugfix release: only minor bugs were to be fixed. Users are encouraged to upgrade, of course.
  • [FIXED] IE/Mac: The button tag doesn't work properly, so it was replaced with the appropriate input tag.
  • [FIXED] IE/Mac: Ian Hickson's validating flash binding example doesn't work properly (I somehow guessed this would break my neck somewhen ;-). The adoption was removed. The Flash file within the gallery now works as suggested in IE, Omniweb and Safari on the Mac, too.
  • [FIXED] Apostrophe detection in convertStr() works properly.
  • [FIXED] Every image caption input tag is now properly limited to 255 characters.
  • [FIXED] Problems with the login were tried to be solved by adding ini_set('session.use_trans_sid', 1); to the server configuration part of SimpleViewerConfig.php.
Version 1.0 (2004-05-24)
Initial release. No bugs here. ;)
License
This piece of code is released under the terms of the Attribution-NonCommercial-ShareAlike 2.0 License of Creative Commons as Open Source software.
That means you are free:
  • to copy, distribute, display, and perform the work
  • to make derivative works
Under the following conditions:
  • Attribution. You must give the original author credit.
  • Noncommercial. You may not use this work for commercial purposes.
  • Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.
If you have questions about the Attribution-NonCommercial-ShareAlike 2.0 License, please read the legal code (the full license), because the above is a human-readable summary only), or feel free to contact me.
The software of this project is shipped with no warranty, but available for free. And as everybody else I like getting appreciation for my work. So if you think I did something useful, have a look at my wishlist.
up