Updated again so that the rss feed supplies the images in a format that the google photos screensaver recognises...
<?php
//
// Coppermine RSS 2.0 Generator (1.0)
// displays latest photo via RSS 2.0 feed.
// Compatible with : Coppermine 1.3.x
//
// Hacked at : 22 October 2005, 0400 +0800
//
// Copyright (C) 2005 Mohammad Hafiz bin Ismail (mypapit)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
// Report problems and direct all questions to:
//
// <mypapit@gmail.com>
//
// For latest version of this software, please visit :
//
// http://mypapit.net/pproject
// http://blog.mypapit.net/
//
// authors email : mypapit@gmail.com, papit01@lycos.com
//
//
// Modified by Wieland E. Kublun www.kublun.com on 29/September/2006
//
// Now this mod displays the album's title and description
$upperlimit = 6; //default = 6
define('INC_COMMENT_TIMES', false);
define('FILEDUMP', false);
define('GZ_COMPRESS', false);
// [0.0 <= priority <= 1.0]
define('P_DISPLAYIMAGE', 0.5);
define('P_ALBUM', 0.5);
define('P_CATEGORY', 0.5);
// [changefreq = always || hourly || daily || weekly || monthly || yearly || never]
define('CF_DISPLAYIMAGE', 'unspecified');
define('CF_ALBUM', 'unspecified');
define('CF_CATEGORY', 'unspecified');
define('IN_COPPERMINE', true);
require('include/init.inc.php');
// This should work as it is, but hardcode if necessary.
define('CPG14', version_compare(COPPERMINE_VERSION, "1.4.0", ">="));
define('PHP5', version_compare(phpversion(), "5", ">="));
$base = rtrim($CONFIG['ecards_more_pic_target'], '/');
$albumpath = "$base/" . $CONFIG['fullpath'];
function lmdate($timestamp)
{
if (PHP5){
return date('c', $timestamp);
} else {
return date('D, d M Y H:i:s +0800', $timestamp - date('Z'));
}
}
// No user servicable parts below here
ob_flush();
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\"
xmlns:media=\"http://search.yahoo.com/mrss/\"
xmlns:dc=\"http://purl.org/dc/elements/1.1/\" >";
$result = mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title ASC");
while (list($aaid, $atitle, $adescription) = mysql_fetch_row($result)) {
print "<channel>\n";
print "<title>$atitle</title>\n";
print "<link>$base</link>\n";
print "<description>$adescription</description>";
print "<language>en-GB</language>\n";
print "<lastBuildDate>" . lmdate(time()) . "</lastBuildDate>\n";
print "<generator>Coppermine RSS 2.0 Generator (1.0)</generator>\n";
$result2 = mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, pwidth, pheight FROM {$CONFIG
['TABLE_PICTURES']} WHERE aid=$aaid ORDER BY ctime DESC, pid DESC LIMIT
0,$upperlimit");
while (list($pid, $aid,$desc, $ctime, $title, $keywords,$filepath,$filename, $owner, $width, $height) = mysql_fetch_row($result2)) {
print "\t<item>\n";
print "\t\t<title> $title </title>\n";
print "\t\t<link>$base/displayimage.php?pos=-$pid</link>\n";
print "\t\t<author>$owner</author>\n";
print "\t\t<pubDate>" . lmdate($ctime) . "</pubDate>\n";
print "\t\t<description>";
echo htmlentities("<p><a href=\"$base/displayimage.php?pos=-$pid\"><img src=\"$albumpath$filepath"."thumb_$filename\" alt=\"\" border=\"0px\" /></a></p>");
echo htmlentities("<a href=\"$base/displayimage.php?pos=-$pid\">$title</a><br/><br/><br/>$desc");
print "</description>\n";
print "\t\t<keywords>";
echo htmlentities("$keywords");
print "\t\t</keywords>\n";
print "\t\t<media:content url=\"$albumpath$filepath$filename\" height=\"$pheight\" width=\"$pwidth\"/>";
print "\t\t<media:title>$title</media:title>";
print "\t\t<media:description type=\"html\">";
echo htmlentities("$desc");
print "</media:description>";
print "\t\t<media:thumbnail url=\"$albumpath$filepath"."thumb_$filename\" />";
print "\t\t<media:credit role=\"photographer\">$owner</media:credit>";
print "\t\t<media:category>";
echo htmlentities("$keywords");
print "</media:category>";
print "\t</item>\n";
print "\n";
}
print "</channel>";
}
print "</rss>";