Configuration

This post will cover the organization, behavior and setup involved to get a Plogger gallery integrated into your website.

Gallery Organization:

Plogger has a two-level hierarchical organization. The two basic containers — “Collections” and “Albums” — are the building blocks you will use to create your gallery. To put it simply, “Collections” contain “Albums” and “Albums” contain your photographs. In order to have a complete gallery you need one collection and one album at a minimum. When using the Plogger Administrative Tools to create your gallery, navigate the hierarchy in much the same way you would navigate the Windows file system. Click the name of your created collection in order to navigate deeper into the hierarchy. Once you click the collection’s name you will be able to create albums inside that collection.

Create a “Collection” by placing a name and description in the “Add Collection” dialogue. The name will be displayed in your gallery underneath the thumbnail. Although the description is entirely optional, putting text in the description attribute will help you identify collections as well as occupying the “tool-tip” text of thumbnails in your gallery (through the IMG title attribute). Similarly, the album descriptions will appear as “tool-tips” for the album thumbnails when browsing a collection.

Configuring Plogger:

Plogger contains quite a few options to customize the way your gallery works. First of all, gallery thumbnails can be configured to any size you specify. You may be wondering why you need to specify the height for the small thumbnails and the width for the large thumbnails. Once given a particular height, Plogger will automatically scale the picture thumbnails and determine the appropriate width based on the dimensions of the original photo. Making the height of all your gallery thumbnails the same ensures that thumbnail rows will all align properly and the thumbnail containers will flow linearly into your container. Since the large thumbnail is displayed by itself on the page, Plogger accepts the width only so that you can get the large-view thumbnail to fit horizontally into your container.

If you don’t like the recursive download feature — turn it off.
If you don’t like user’s to be able to comment on your pictures — turn it off.
If you don’t want to have the auto-print link added to your individual pictures — turn it off.

All of these things are configurable through the “Options” tab.

A couple of words about the recursive download feature. Plogger will automatically generate compressed packages of collections, albums or individual pictures and serve them up to the browser. For example, consider the situation in which you have two collections named “Travel” and “People”. If someone browsing your gallery checks both collections and clicks “Download Selected”, the server will recurse through both collections, recurse through all albums within those collections, and generate a compressed package containing all the pictures it can find. Inside the package the directory structure of the compressed files will mirror the hierarchical relationships you have embedded in your gallery. The file type that is served up is tar.gz, which may look foreign to you Windows users. A tar.gz file is basically just a ZIP file and most windows compression software will be able to handle it (I know WinZIP does…).

Importing Images to Plogger:

Plogger offers you two options in getting images into your gallery. The first option is located on the “Upload” tab and allows you to upload individual photos to your gallery through a web based form. The second option — called “Import” — allows you too move files in large groups into your database.

To utilize the “Import” feature you will need to establish an FTP connection with your web server. If you are not comfortable with FTP then you will have to upload images individually from the “Upload” tab, a very slow process. Quite simply, upload as many image files as you want into the /uploads/ directory on your web server. Once you click the “Import” tab, Plogger will scan the /uploads/ directory for valid image files and display a list of them with their thumbnails, captions, and destinations. You can set the destination for each photo manually by manipulating the drop-downs or move all photos to the same destination by checking “bypass individual destinations” and setting the appropriate album. Plogger will physically move your images out of the /uploads/ directory and into the /images/ directory, as well as making the necessary database entries automatically.

Integrating a Plogger Gallery:

So you may have a site in which you simply want to “drop-in” a Plogger gallery to a specific page. Plogger is designed to make this as simple as possible with a total of three lines of PHP needed to get it to work properly.

First thing, your file MUST have a PHP extension. This file must be processed through the PHP interpreter in order to be dynamic. The second important thing is to require the necessary file — gallery.php — into your page. To do this, include this line:

<?php include("gallery.php"); ?>

Inside the quotes should be the relative path to this specific file. Be sure that your gallery template resides in the same directory as gallery.php or else the following function calls will not resolve the CSS paths properly.

Next, you must include a PHP statement within the HEAD section of your HTML. Simply place the following function call anywhere in between the opening and closing HEAD tags in your document:

<?php the_gallery_head(); ?>

This function is necessary to bring in the gallery.css file link as well as an included javascript file used in some of the dynamic features of the gallery. If your gallery template does not reside in the Plogger directory, you can place the following links manually with relative paths adjusted to fit your site organization. Therefore, if your gallery template in in your root directory and your Plogger system files are in your /plogger/ directory, the lines wouldl look like this:

<link rel="stylesheet" type="text/css" href="plogger/css/gallery.css" />
<script type="text/javascript" src="plogger/dynamics.js"></script>

The final and most important line of PHP to integrate your gallery is the following:

&lt;?php the_gallery();?&gt;

It’s as simple as that. Place this statement anywhere you want your gallery to appear on the page. You should notice that the gallery produces a CSS unordered list with display:inline attributes. This makes the thumbnails automatically flow to fill the container in which they reside. Changing the thumbnail sizes will result in the gallery automatically reflowing to accommodate it’s new parameters.

That’s it! Your gallery can be viewed at http://www.yoursite.com/plogger/ (or whatever you decide to name the directory) and your administrative tools are at http://www.yoursite.com/plogger/admin.

I’m not sure if it makes a difference, but for some reason Wordpress is adding a space between the left bracket and the question mark of the tag, this should not be there.

Please post any installation problems, questions or remarks to the comments on this post.


About this entry


You may also enjoy


Recent comments