OK, I read the FAQ on the subject, but it doesn't really explain how to use a PHP file instead of an HTML file. I assumed (apparently incorrectly), that the way to do this was to:
1. paste all the code from your php page you want to use into the theme.php file for your selected template
2. copy all the code out of the template.html file and insert it into the theme.php file where you want the gallery to appear
When I do that, my theme.php code looks like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>UTILIKILTS : </title>
<style type="text/css" media="handheld, aural, braille, tv, print"><!--@import url("../../../global/css/mobile.css");--></style>
<style type="text/css" media="Screen, projector"><!--@import url("../../../global/css/global.css");--></style>
</head>
<body>
<!--Begin Outer Red Box-->
<div id="redBox">
<!--Begin Inner Container-->
<div id="container">
<!--Begin Header-->
<? include ("../../../global/boxes/header.txt"); ?>
<!--End Header-->
<!--Begin Side Navigation Bar-->
<? include ("../../../community/boxes/main.txt"); ?>
<!--End Side Navigation Bar-->
<!--Beginning of Content Area-->
<!--Maximum width of any item in content area is 550px including borders-->
<div id="content">
<h1>{GAL_NAME}</h1>
<table width="100%" border="0" cellpadding="20" cellspacing="20">
<tr>
<td valign="top" style="border: 1px solid #666666;background-color:#FFFFFF;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a href="index.php"><img src="themes/uk/images/site_logo.png" border="0" alt="" /></a><br />
</td>
<td width="100%" align="center">
<h3>{GAL_DESCRIPTION}</h3><br />
{SYS_MENU} <br /> {SUB_MENU}
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
{LANGUAGE_SELECT_FLAGS}
</td>
</tr>
<tr>
<td align="center" valign="top">
{THEME_SELECT_LIST}
{LANGUAGE_SELECT_LIST}
</td>
</tr>
</table>
<img src="images/spacer.gif" width="1" height="15" alt="" />
<br />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
{ADMIN_MENU}
{GALLERY}
</td>
</tr>
</table>
</td>
</tr>
</table>
</p>
</div>
<!--End of Content Area-->
<!--Begin Footer-->
<? include ("../../../global/boxes/footer.txt"); ?>
<!--End Footer-->
</div>
<!--End Inner Container-->
</div>
<!--End Outer Red Box-->
</body>
</html>
But here's how it looks in the browser:
http://216.69.130.253/gallery/index.php?cat=8