I did a little expanding modification that might be useful. The RSS generator is now capable to generate a newsfeed for any album now, too.
Usage:
Save the code as "rss.php" within your theme folder then place the links into your themes:
1) On any theme file the common rss feed for the whole gallery:
`RSS`
2) On album.php and image.php the album rss feed for the currently selected album:
`<a>&albumname=<?php printAlbumTitle(); ?>">RSS for this album</a>`
Or you can place the rss.php within the zenphoto root in this thread:folder and called it via your theme like this:
`RSS`
or
`<a>&albumname=<?php printAlbumTitle(); ?>">RSS for this album</a>`
Here is the code:
`
<?php
header('Content-Type: application/xml');
require_once("zen/template-functions.php");
$themepath = 'themes';
require_once("zen/zp-config.php");
$albumnr = $_GET[albumnr];
$albumname = $_GET[albumname];
if ($albumname != "")
{ $albumname = " - album: ".$_GET[albumname]; }
?>
<rss version="2.0">
<channel>
<title><?php echo $conf['gallery_title']; ?><?php echo $albumname; ?></title>
<link><?php echo "http://".$_SERVER["HTTP_HOST"].WEBPATH; ?></link>
<description><?php echo $conf['gallery_title']; ?></description>
<language>en-us</language>
<pubDate><?php echo date("r", time()); ?></pubDate>
<lastBuildDate><?php echo date("r", time()); ?></lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Acrylian's ZenPhoto RSS Generator based on Alenônimo's ZenPhoto RSS Generator which is based on ThinkDreams' Generator...:-)</generator>
<managingEditor><?php echo $conf['admin_email']; ?></managingEditor>
<webMaster><?php echo $conf['admin_email']; ?></webMaster>
<?php
$iw = $cw = 300; // Image Width
$ih = $ch = 300; // Image Height
$items = 10; // # of Items displayed on the feed
mysql_connect($conf['mysql_host'],$conf['mysql_user'],$conf['mysql_pass']);
mysql_select_db($conf['mysql_database']) or die( "Unable to select database");
if ($albumnr != "")
{ $sql = "SELECT * FROM ". prefix("images") ." WHERE albumid = $albumnr ORDER BY id DESC LIMIT ".$items;}
else
{ $sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT ".$items; }
$result = mysql_query($sql);
while($r = mysql_fetch_array($result)) {
$id=$r['albumid'];
if ($albumnr2 != "")
{ $sql="SELECT * FROM ". prefix("albums") ." WHERE id = $albumnr2"; }
else
{ $sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id"; }
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
?>
<item>
<title><?php echo $r['title'] ?></title>
<link><?php echo '<![CDATA[http://'.$_SERVER["HTTP_HOST"].WEBPATH.'/index.php?album='.$a['folder'].'&image='.$r['filename'] . ']]>';?></link>
<description><?php echo '<![CDATA[<a title="'.$r['title'].' in '.$a['title'].'">[img]http://'.$_SERVER[[/img]</a>
' . $r['desc'] . '
]]>';?> <?php if($exif['datetime']) { echo '<![CDATA[Date: ' . $exif['datetime'] . '
]]>'; } ?></description>
<guid><?php echo '<![CDATA[http://'.$_SERVER["HTTP_HOST"].WEBPATH.'/index.php?album='.$a['folder'].'&image='.$r['filename'] . ']]>';?></guid>
</item>
<?php } ?>
</channel>
</rss>
`