Phoghorn is a web-based image gallery with built-in automatic thumbnail generator for spiffy the webserver.
Its features are:
By default, phoghorn assumes there is a directory called galleries
in the directory from which you call its functions (ie, the same directory in which you placed index.ssp
). It will create thumbnails on-the-fly when there aren't any yet, and only for those pictures on the page that is currently being viewed. By default, these will be placed in the thumbs
directory under the gallery's directory.
In the main page (save this as index.ssp
):
<?scheme (use phoghorn) ?> <html> <head> <title>Phoghorn example</title> </head> <body> <?scheme (parameterize ((ph:movie-image "/pics/movie.jpg")) ; Default is #f (ph:show-gallery)) ?> </body> </html>
In the zoomed-in page (save this as zoomed.ssp
):
<?scheme (use phoghorn) ?> <html> <head> <!-- The current photo's filename is the title --> <title><? (ph:get-entry) ?></title> </head> <body> <?scheme (parameterize ((ph:movie-image "/pics/movie.jpg")) ; Default is #f (ph:show-zoomed-entry)) ?> </body> </html>
Note that currently there's no support for calling phoghorn from SXML pages. This is an important shortcoming and the intention is to rewrite the output functions to SXML for the next release.
Phoghorn can be customised to the max. The following SRFI parameters are supported:
The output can most easily be looked at in the source view of your favorite browser, but to style it with CSS it is handy to have a reference. There is an example CSS file in the examples section.
All phoghorn output is wrapped in a div
element of class phoghorn
. It also has class gallery
when in thumbnail view, and class zoomed
in zoomed view.
Links above and below the image are inside a div
of class navigation
. The image itself is inside a div
of class entry
.
The list of subgalleries, if present, is inside a div
of class gallerytree
. The list itself is an ul
. The list item of the link to the parent gallery, if present, has class uplink
.
Below the subgalleries list (and repeated again below the gallery) is a div
of class navigation. This navigation has the links to the other pages. The current page number is not a link, but a span
of class curpage
.
The gallery itself is inside a table
, containing the thumbnails.
/* * All stuff Phoghorn outputs is centered, and in a sans-serif font of a * decent size. Any stuff above or below the Phoghorn output is separately * on a new line. */ div.phoghorn { text-align: center; font-family: arial, tahoma, verdana, helvetica; font-size: 12px; clear: both; } /* A blue background for the thumbnails */ div.phoghorn table { background-color: #6688bb; } /* Current page in thumbnail view shown in red */ div.phoghorn .curpage { color: red; } /* We show the gallery tree in a table-like fashion */ div.phoghorn .gallerytree { display: block; text-align: center; width: 100%; } div.phoghorn .gallerytree li { /* background-color: #cc0000; */ display: block; /* Remove leading list-bullets */ width: 200px; /* Link text is left-aligned inside */ text-align: left; /* the 200 pixels-wide `li' element */ float: left; /* Don't make them start a new line */ padding-bottom: 10px; /* Leave room between them vertically */ } div.phoghorn .gallerytree li.uplink { width: 100%; /* The uplink is on its own line */ text-align: center; /* Centered */ } /* Start the table on its own line, not to the right of the navigation */ div.phoghorn table { clear: left; }
Copyright (c) 2005 - 2006, Peter Bex (peter.bex@xs4all.nl) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.