PHP XML Photo Captioner
a web app to create XML caption files for my photos

This is a PHP web app that I wrote to store captions for my digital camera photos. It writes the data to an XML file in each directory. Then I use XSL to convert the XML files to my photo gallery pages. This makes it very flexible for display. It's pretty plain looking:

Setup

This requires PHP4. Just dump the captioner.php file into your photo directory. You can use this URL directly, or you can run it through a frameset, which makes it a little more convenient. The frameset I use is start.html, which puts the directory listing on the left and the actual editor on the right. If it doesn't work, make sure the PHP process is able to write files to the photo directory.

Customization

These variables at the top of the code should cover most needs:

Example output

<?xml version="1.0"?>
<photo_batch>
    <date>November 2001</date>
    <title>Real Italy</title>
    <directory name="Day02">
        <thumbnail>DSCF1399.JPG</thumbnail>
        <short_descript>Day 2 - Rome</short_descript>
    </directory>
    <photo filename="DSCF1399.JPG">
        <short_descript>The Fountain of the Four Rivers</short_descript>
        <long_descript>Much nicer w/o the flash.</long_descript>
    </photo>
</photo_batch>

Example XSL

This is the XSL that I use to generate the photo gallery on this site. I use xlstproc to generate the html, and wwwis to throw proper img height and width on. Neat trick: If you add a line like this to the top of the XML:

<?xml:stylesheet type="text/xsl" href="http://hostname/photo_batch.xsl"?>

you can open the XML files in IE 5.5 directly, without pre-generating html.  

home