pyxy-gallery documentation

pyxy pixie pyxy pixie

Installation

To install pyxy-gallery, simply unzip the .php file and move it into a directory on your web server with lots of images in it.

Pyxy-gallery will automatically download the file prototype.js and place it in the directory where you installed pyxy. If you do not want this to happen, set $pref['autoinstall'] = 0;, as described below. If the automatic installation fails, you will need to download this file yourself and install it as prototype.js. (You don't need to turn off the autoinstaller if you do this.)

— lightbox.js support —

lightbox.js cannot be automatically installed. There are several files involved, and some of them are images- and chances are you don't want these images showing up in your gallery.

If you would like to install lightbox.js, you should download it from the official lightbox.js site and place it a directory somewhere in your web server. Then, set $pref['lightbox_path'] to that directory (be sure to use a trailing slash!). For example, on fennecfoxen.org I installed lightbox.js into /shiny/js/lightbox, so I would set $pref['lightbox_path'] = '/shiny/js/lightbox/'. Finally, set $pref['lightbox_ver'] to either 1 or 2, depending on which version of Lightbox you use.

You may also need to edit the lightbox.js file to reference the images that lightbox.js uses. Update the lines that set var loadingImage and var closeButton so that they point to an actual image file. This is necessary for the animated progress bar and Close button to appear.

Setting preferences

You could set prefrences just by editing the Pyxy PHP script- but then you couldn't update it, or you'd lose all your settings. Instead, create a file pyxy.pref.inc* in the directory where you instally pyxy-gallery, and put your preferences in it. Since it's a PHP file, you should use <?php ?> tags around the preferences -- in fact, you should be careful to put those at the very very start of the file and at the very very end, or Pyxy will be unable to send some HTTP headers and you will get some ugly-looking PHP warnings telling you about that fact (and it will probably break your thumbnails as well).

* In v1.10 and before, this file is named pref.inc

— Sample pref.inc file —

Here is a sample pyxy.pref.inc file. It sets lightbox_path to activate lightbox.js.

<?php
 $pref['lightbox_path'] = '/shiny/js/lightbox/';
 $pref['lightbox_ver'] = 1;
 $pref['title'] = $pref['pagetitle'] = "My Cool Gallery";
 $pref['caption'] = "Hello, and welcome to my ultra-cool gallery!";
 $pref['show_date'] = 0;
 $pref['quality'] = 60; 
 ?>

Preference Reference

— Operation preferences —

$pref['dir']
Set this if you want Pyxy to display images from another directory than the one it's installed in. It has to be a relative path, so that it works on the browser and on the web server's file system.
$pref['filetypes']
Set this to a list of file types that you want Pyxy to display. But careful! You still can't use Pyxy to load things like .tiff or .bmp - PHP doesn't understand how to load this. Maybe in another release...
$pref['autoinstall']
Set this to 0 if you don't want Pyxy to try to automatically check for and download prototype.js for you.
$pref['prototype_path']
Some webmasters already have a prototype.js file on their website. Good for you! Set prototype_path to the location of this file and turn off autoinstall.
$pref['lightbox_path']
$pref['lightbox_ver']
See the installation notes above for details on lightbox.js support.

— Page preferences —

$pref['title']
This is the title Pyxy uses for browser (in the <title> part of the page). You can use the variable $title to get the name of the directory you're in, and $titlec to get it with a capitalized first letter. The default value is "Gallery: $titlec".
$pref['pagetitle']
This is the title Pyxy will display on the page itself (in the <h1> header). You set it just like $pref['title'].
$pref['caption']
This is the text that appears at the top of the page, underneath the page title. It defaults to "(this gallery has no description)" - you can set it to whatever you like, include HTML, have fun.
$pref['max_per_page']
This will control how many pictures you have on a page. The default is 8.
$pref['pics_per_row']
This will control how many pictures you have per row. The default is 4.
$pref['sort']
This controls the order in which pictures are sorted. By default, pictures will be sorted by filename. The value of this preference should be a string, one of: "url" (for the filename), "mtime" (file modification time), "width", "height", or "filesize".
$pref['show_pic']
Set this to 0 if you don't want to show a thumbnail of the picture. (Why don't you want to show the thumbnail?!) Note that you should either leave show_pic or show_url on so that you can actually link to the picture.
$pref['show_url']
Set this to 0 if you don't want to show the name of the picture. If you turn this off, you'll probably want to leave show_pic on, or you're not going to have any link to the picture!
$pref['show_date']
Pyxy will display the time when the image was last modified... unless you set this to 0.
$pref['show_size']
Set this to 0 and Pyxy will stop displaying the file size of the image.
$pref['show_res']
Set this to 0 and Pyxy will stop displaying the resolution of the image.

— Thumbnail preferences —

$pref['maxH']
This will set the maximum height of image thumbnails.
$pref['maxW']
This will set the maximum width of image thumbnails.
$pref['quality']
This will set the quality of the image thumbnails that Pyxy generates. This is a JPEG quality setting, on a scale of 0 to 100. Higher quality looks better, but it means more bandwidth! Really low quality settings look incredibly ugly, though. The default is 80. You might want to turn this down as low as, oh, 60 or so if you want to save bandwidth at the expense of decent-looking thumbnails.

— Include files —

pyxy.pref.inc
This is the file where you set all the preferences. Use <?php ?> tags at the very start and the very end! Otherwise, the file will output text in places that it shouldn't and this will break things!
pyxy.footer.inc
This file, if present, will be added at the bottom of the page. Stick whatever HTML PHP code you want in there. (Hit counters? Google Analytics tracking code? Advertisements?)