I've modified this script so it shows title and description for each item, I'm attaching it .txt (rename it to .php) and code...
<?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
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">";
print "<channel>\n";
print "<title>{$CONFIG['gallery_name']}</title>\n";
print "<link>$base</link>\n";
print "<description>{$CONFIG['gallery_description']}</description>";
print "<language>es-MX</language>\n";
print "<lastBuildDate>" . lmdate(time()) . "</lastBuildDate>\n";
print "<generator>Coppermine RSS 2.0 Generator (1.0)</generator>\n";
$result = mysql_query("SELECT tb.pid,tb.aid,ta.aid,ta.description,tb.ctime,ta.title,tb.keywords,tb.filepath,tb.filename FROM {$CONFIG['TABLE_PICTURES']} tb LEFT OUTER JOIN {$CONFIG['TABLE_ALBUMS']} ta ON tb.aid = ta.aid ORDER BY tb.pid DESC LIMIT 0,$upperlimit");
while (list($pid, $aid,$aaid,$desc, $ctime, $title, $keywords,$filepath,$filename) = mysql_fetch_row($result)) {
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>{$CONFIG['gallery_admin_email']}</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 "<a href=\"$base/displayimage.php?pos=-$pid\">$title</a><br/><br/><br/>$desc<p>$keywords</p>";
print "</description>\n";
print "\t</item>\n";
print "\n";
}
print "</channel>";
print "</rss>";
[Edit By Sami]:
Orginaly splited from this thread:
http://forum.coppermine-gallery.net/index.php?topic=11081.0
as it's working with 1.4.x version
It seems that its working with CPG1.4.x , am I right?
Quote from: Sami on September 30, 2006, 06:57:16 AM
It seems that its working with CPG1.4.x , am I right?
I don't know, but it's working for me in CPG 1.3.x
It's working on 1.4.x so I moved it to Mods: content syndication (cpmFetch) board as a new port of an old mod (http://forum.coppermine-gallery.net/index.php?topic=11081.0)
i suppose php script should end with
?>
AFAIK it works without that tag but you can put it if you want ;)
Hi. I am trying to get this to work on my Gallery, but I belive I am missing something.
I copied the rss.php file and made the proper changes to it so it points to my gallery, but when I try to point to it, IE gives me an error. When I try to validate it, same error.
http://gallery.poserpacks.com/rss.php
I am getting a Server 500 Error. Not sure what that means.
I am sorry if this is the wrong area to post this, just was not sure where else.
Can anyone help me here please?
THANK YOU VERY MUCH...
Quote from: cornelp on October 06, 2006, 10:13:25 PM
I copied the rss.php file and made the proper changes to it so it points to my gallery
It doesn't need any modification , it will find your gallery when you copy it ,use orginal rss.php and check that again
I copied the rss file again (the original) with no changes, and i get the SAME ERROR.
Perhaps I am doing something wrong? Pretty much just took the file, copied it to the main site thru FTP and tried to launch it, but get the Error 500.
http://gallery.poserpacks.com/rss.php
Am I supposed to use any parameters in the link?
I am sorry, just new to this RSS. I got the Main Site RSS FEED to work, and the Forums (SMF), but I cant get this one to work.
Thank You for your help on this...
Cornelp
Sorry but it seems it's not well-formed and didn't work with some Servers
Ohhh darn it, I wanted to use it badly.
Maybe it has to do with the subdomain. I am using the gallery part of the site with a subdomain name. I dont know, maybe i can contact the host and ask them about it.
THANK YOU FOR YOUR TIME. Very much appreciate it.
Cornelp.
I apologize in advance if this is a silly question. A forum search revealed one other instance of my question but the poster resolved his problem without posting his solution.
I've copied over wieland's file to my coppermine directory, I'm calling the rss.php feed through a joomla module. The links display perfectly but when I click I'm taken, literally to "www.mysite.com/coppermine/".
I'm a little stumped as to where rss.php is pulling "www.mysite.com" from as the base url for my coppermine gallery. A nudge in the right direction would be appreciated.
Thanks in advance.
What did you set in Coppermine config for your gallery's url ?
Sorry for the delay, I was double checking posts on all the various RSS feeds to make sure I hadn't overlooked something silly.
Under Config, my base url is set at "http://www.batistaweb.com/coppermine/"
rss.php = http://www.batistaweb.com/coppermine/rss.php
??? As not to waste anyone's time, I'm putting this request/plea for help on hold. The script is not behaving as it did when I initially posted, nor is it behaving as I expected. Further reading suggests that the bridged nature of my Coppermine install may, at least be contributing to my problems.
Nibbler, I totally appreciate your response though, thank you.
Thanks for sharing this rss.php script.
It seems to be working for me.
However it does not seem to obey authorization. I have some private albums as well as some public ones. It seems to show images from the private albums even when not logged into coppermine.
Those with private albums should be sure to test this.
There is nothing in the mod to enable it to respect viewing permissions, album passwords, or unapproved files. There is also nothing there that would cause issues with a bridged gallery.
Hi All,
CPG 1.4.9
Paypal shopping cart mod (custom displayimage.php file)
Just tried dropping this little RSS mod into the gallery root, unchanged save for the file name to .php
Tried to validate but it failed (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.aeronauticpictures.com%2Froyalty-free-stock-footage%2Frss.php).
The feed url is here (http://www.aeronauticpictures.com/royalty-free-stock-footage/rss.php).
Wondering if the Paypal mod is to blame? Any ideas? Thanks!
Quote from: Aeronautic on December 23, 2006, 02:40:23 AM
The feed url is here (http://www.aeronauticpictures.com/royalty-free-stock-footage/rss.php).
Please disregard that url for the feed. It is too late to edit my first post or I would have. I've switched to CpmFetch & CfRSSGet and set-up a 301 for that old url since it seems to be already getting hits from all over the place.
The new feed does validate and since I run custom thumbs for my Quicktime movies, while the RSS feed in this thread is handy, as Nibbler stated, it does not know of, or respect private albums which resulted in the feed displaying custom thumbs in an album not open to the public. CFRSSGet is only showing the public content as indicated earlier in this thread.
Thx!
Sorry if my post is not for here :-\
What will be the source of rss.php if the feed have to show:
thumb 150x100 </ br>
discription
I think this will be helpfull for many people for last upload pic boxes in CMSystems :)
I'm not getting a title on my feed and it doesn't validate, also neither my IE7 or firefox or safari are saying there is a feed available (no live feed icon) even though when you actually go to the feed it works and you can subscribe to it from there. http://www.ghsimages.co.uk/ (http://www.ghsimages.co.uk/)
Does your gallery have a name? I expect you need to add code into your <head> for the browser to know there is a feed available.
OK I've put the name in the title tag but still no joy.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="mssmarttagspreventparsing" content="true" />
<title>GHS Images</title>
<meta name="keywords" content=""/>
<meta name="description" content=""/>
{META}
<link rel="stylesheet" href="themes/chaoticsoul/style.css" type="text/css" />
<script type="text/javascript" src="scripts.js"></script>
<link rel="shortcut icon" href="favicon.ico" />
</head>
Quote from: Aeronautic on December 23, 2006, 02:40:23 AM
Hi All,
CPG 1.4.9
Paypal shopping cart mod (custom displayimage.php file)
Just tried dropping this little RSS mod into the gallery root, unchanged save for the file name to .php
Tried to validate but it failed (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.aeronauticpictures.com%2Froyalty-free-stock-footage%2Frss.php).
The feed url is here (http://www.aeronauticpictures.com/royalty-free-stock-footage/rss.php).
Wondering if the Paypal mod is to blame? Any ideas? Thanks!
Can you tell us how you got it to work the way you have it? Can you post the code please?
i've put RSS.php on my server, it works, it takes the image & the category names, but it doesn't take the link well :(
it gives me the link: http://www.avatar-paradise.com/displayimage--1650.html and it should be http://www.avatar-paradise.com/displayimage-27-0.html
the difference is that in RSS it gives me: displayimage--PID.html and it should be displayimage-AID-position_in_the_album.html
i tried to modify the RSS.php, but it gives me: displayimage--27.html - i don't know how to get rid of one "-" and to put after the $aid the position in the album of the image :(
print "\t<item>\n";
print "\t\t<title> $title </title>\n";
print "\t\t<link>$base/displayimage.php?pos=-$aid</link>\n";
I'm using this and I keep getting the album name, not the title of the file uploaded, is there away of changing this
the feed is http://cdcoverhideout.com/gallery/rss.php (http://cdcoverhideout.com/gallery/rss.php) ;D
Here is my mod to this:
<?php
// Dieg0.com.ar RSS 2.0 Generator
// displays latest photo via RSS 2.0 feed.
//
// Modified by Diego Bretti www.Dieg0.com.ar on 28/Feb/2007
//
// Copyright (c) 2007 Diego Bretti
//
// This mod displays the album's title and description
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$base = rtrim($CONFIG['ecards_more_pic_target'], '/');
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">\n";
print "<channel>\n";
print "<title>{$CONFIG['gallery_name']} - RSS Albums</title>\n";
print "<link>$base</link>\n";
print "<description>{$CONFIG['gallery_description']}</description>\n";
print "<language>es-AR</language>\n";
print "<category>{$CONFIG['gallery_name']}</category>\n";
print "<lastBuildDate>" . date('D, d M Y H:i:s +0800') . "</lastBuildDate>\n";
print "<copyright>Copyright (c) 2007 Diego Bretti</copyright>\n";
print "<generator>Dieg0.com.ar RSS 2.0 Generator</generator>\n";
print "<docs>$base/rss.php</docs>\n";
print "<ttl>10</ttl>\n";
print "<image>\n";
print "<title>{$CONFIG['gallery_name']}</title>\n";
print "<url>http://www.dieg0.com.ar/image/valid-rss.png</url>\n";
print "<link>$base</link>\n";
print "</image>\n";
//LIMIT 0,*
$result = mysql_query("SELECT aid,title FROM cpg_albums ORDER BY aid DESC LIMIT 0,10");
while(list($album,$title) = mysql_fetch_row($result))
{
$result2 = mysql_query("SELECT pid,filepath,filename,ctime FROM cpg_pictures WHERE aid=$album ORDER BY pid ASC LIMIT 5");
print "\t<item>\n";
print "\t\t<title>$title</title>\n";
print "\t\t<author>{$CONFIG['gallery_name']}</author>\n";
print "\t\t<link>$base/thumbnails.php?album=$album</link>\n";
print "\t\t<guid isPermaLink=\"true\">$base/thumbnails.php?album=$album</guid>\n";
print "\t\t<description>\n";
$result3 = mysql_query("SELECT COUNT(*) FROM cpg_pictures WHERE aid=$album");
$aid = mysql_fetch_row($result3);
if($aid[0]==1)
{print "\t\t<![CDATA[Foto del álbum "<a href=\"$base/thumbnails.php?album=$album\">$title</a>".<br/><br/>]]>\n";}
elseif($aid[0]>1 && $aid[0]<=5)
{print "\t\t<![CDATA[Fotos del álbum "<a href=\"$base/thumbnails.php?album=$album\">$title</a>" con " . $aid[0] . " imágenes.<br/><br/>]]>\n";}
else
{print "\t\t<![CDATA[Primeras fotos del álbum "<a href=\"$base/thumbnails.php?album=$album\">$title</a>" con " . $aid[0] . " imágenes.<br/><br/>]]>\n";}
$time='';
while(list($pid,$filepath,$filename,$ctime) = mysql_fetch_row($result2))
{
print "\t\t<![CDATA[<a href=\"$base/displayimage.php?pos=-$pid\"><img src=\"$base/albums/$filepath" . "thumb_$filename\" alt=\"\" border=\"0px\" /></a> ]]>\n";
$time=$ctime;
}
// $result4 = mysql_query("SELECT SUM(hits) FROM cpg_pictures WHERE aid=$album");
// $hits = mysql_fetch_row($result4);
// print "\t\t<![CDATA[<br/><br/>" . $hits[0] . " imágenes vistas desde el " . date('d M Y', $time - date('Z')) . ".]]>\n";
// print "\t\t<![CDATA[<br/><br/>Álbum creado el " . date('d M Y', $time - date('Z')) . ".]]>\n";
print "\t\t</description>\n";
print "\t\t<pubDate>" . date('D, d M Y H:i:s +0800', $time - date('Z')) . "</pubDate>\n";
print "\t</item>\n";
}
print "</channel>\n";
print "<!--Powered by Diego Bretti-->\n";
print "</rss>";
?>
Comments?
Thanks!
The original worked a charm for me, had a quick look at the second, only prob I had with that is that it didn't recognise any albums, but I'll look into it further, Thanks all another good contribution to the coppermine product :-)
This one is for RSS the Comments:
<?php
// Dieg0.com.ar RSS 2.0 Generator
// displays latest photo via RSS 2.0 feed.
//
// Modified by Dieg0.com.ar on 02/Jun/2007
//
// Copyright (c) 2007 Dieg0 & pepemosca (30/Jun/2007)
//
// This mod displays the photos's comments
define('IN_COPPERMINE', true);
require('include/init.inc.php');
require('include/smilies.inc.php');
$base = rtrim($CONFIG['ecards_more_pic_target'], '/');
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">\n";
print "<channel>\n";
print "<title>{$CONFIG['gallery_name']} - RSS Comments</title>\n";
print "<link>$base</link>\n";
print "<description>{$CONFIG['gallery_description']}</description>\n";
print "<language>es-AR</language>\n";
print "<category>{$CONFIG['gallery_name']}</category>\n";
print "<lastBuildDate>" . date('D, d M Y H:i:s +0800') . "</lastBuildDate>\n";
print "<copyright>Copyright (c) 2007 Dieg0.com.ar </copyright>\n";
print "<generator>Dieg0.com.ar RSS 2.0 Generator</generator>\n";
print "<docs>$base/rss-comments.php</docs>\n";
print "<ttl>10</ttl>\n";
print "<image>\n";
print "<title>{$CONFIG['gallery_name']}</title>\n";
print "<link>$base</link>\n";
print "</image>\n";
$result = mysql_query("SELECT pid,msg_id,msg_author,msg_body,msg_date,msg_raw_ip FROM cpg_comments ORDER BY msg_id DESC LIMIT 0,10");
while(list($r_pid,$r_msg_id,$r_msg_author,$r_msg_body,$r_msg_date,$r_msg_raw_ip) = mysql_fetch_row($result))
{
$result2 = mysql_query("SELECT aid,filename,filepath FROM cpg_pictures WHERE pid=$r_pid");
list($r_aid,$r_filename,$r_filepath) = mysql_fetch_row($result2);
$result3 = mysql_query("SELECT title FROM cpg_albums WHERE aid=$r_aid");
list($r_title) = mysql_fetch_row($result3);
print "\t<item>\n";
print "\t\t<title>Comentario en el álbum "" . $r_title . "" por " . $r_msg_author . "</title>\n";
print "\t\t<author>" . $r_msg_author . "</author>\n";
print "\t\t<link>$base/displayimage.php?pos=-$r_pid</link>\n";
print "\t\t<guid isPermaLink=\"true\">$base/displayimage.php?pos=-$r_pid</guid>\n";
print "\t\t<description>\n";
print "\t\t<![CDATA[<a href=\"$base/displayimage.php?pos=-" . $r_pid . "\"><img src=\"$base/albums/" . $r_filepath . "thumb_" . $r_filename . "\" alt=\"\" border=\"0px\" /></a><br/><br/>]]>\n";
print "\t\t<![CDATA[<b>Álbum:</b> " . $r_title . "<br/><b>Autor:</b> " . $r_msg_author . "<br/><b>Comentario:</b> " . bb_decode(process_smilies($r_msg_body, $CONFIG['ecards_more_pic_target'])) . "<br/><b>IP:</b> " . $r_msg_raw_ip . "<br/>]]>\n";
// Para la tabla de historial
$result4 = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM cpg_comments WHERE pid=$r_pid AND msg_id<=$r_msg_id"));
if($result4[0]>1)
{
print "\t\t<![CDATA[<br/><b>Historial de comentarios:</b><br/>]]>\n";
print "\t\t<![CDATA[<table border=0 cellpadding=2><tr><td><b>Autor</b></td><td><b>Comentario</b></td><td><b>Fecha</b></td><td><b>IP</b></td></tr>]]>\n";
$result5 = mysql_query("SELECT msg_author,msg_body,msg_date,msg_raw_ip FROM cpg_comments WHERE pid=$r_pid AND msg_id<=$r_msg_id ORDER BY msg_id ASC");
while(list($r_msg_author_c,$r_msg_body_c,$r_msg_date_c,$r_msg_raw_ip_c) = mysql_fetch_row($result5))
{
print "\t\t<![CDATA[<tr><td>$r_msg_author_c</td><td>" . bb_decode(process_smilies($r_msg_body_c, $CONFIG['ecards_more_pic_target'])) . "</td><td>$r_msg_date_c</td><td>$r_msg_raw_ip_c</td></tr>]]>\n";
}
print "\t\t<![CDATA[</table>]]>\n";
}
// Fin de la tabla de historial
print "\t\t</description>\n";
print "\t\t<pubDate>" . $r_msg_date . "</pubDate>\n";
print "\t</item>\n";
}
print "</channel>\n";
print "<!--Powered by Dieg0.com.ar-->\n";
print "</rss>";
?>
Comments?
Quote from: kraftworkz on February 16, 2007, 05:18:25 AM
Can you tell us how you got it to work the way you have it? Can you post the code please?
Sure, my cfrssget.php uses the following settings:
if ($ENABLED) {
$partialurltocpm = "/yourcopperminefolder"; //Part of the URL to CPG without the host and domain
$default_command = "last"; //What to do if no cmd is specified
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED
// You only need to use this if you will be using this file as a feed
$rssFeedTitle = "SOMETITLETEXT";
$rssFeedDescription = "SOMEDESCRIPTIONTEXT.";
$rssFeedSiteUrl = "http://www.YOURFULLDOMAIN.com/yourcopperminefolder/";
$rssFeedProviderUrl = "http://www.YOURFULLDOMAIN.com/cpmfetch/rss_lastadded.php";
$rssFeedImageTitle = "SOMETITLETEXT";
$rssFeedImageURL = 'http://www.YOURFULLDOMAIN.com/path/tofeedimage.sometype';
$rssFeedImageLink = "http://www.YOURFULLDOMAIN.com/yourcopperminefolder/";
$rssFeedImageAlt = "SOMEALTTEXT";
$rssItemTitle = "%a SOMETEXT";
$rssItemAlternateTitle = "%a SOMETEXT";
$rssItemDescription = "%f from album %a<br/>%c";
$rssItemAlternateDescription = "%f from %a<br/>%a: %d";
$totalToShow = 22;
///// END OF USER SETTINGS /////////
Replace those generics with your specifics (domain, folders, text, etc.)
Feed in action displayed on another website: stock footage (http://www.aeronautic.net/online-news/task,view/feedid,11/)
I have the same question as Will: I tried this mod (by wieland), but it displays only updated album names, not the titles of the new files.
Is there a way how to display titles of the new files in RSS feed? Thanks for the answer!
I have adapted this code for show the last álbums in the coppermine gallery (with SEO MOD installed)
This is the code:
<?php define('IN_COPPERMINE', true); require('include/init.inc.php'); $base = rtrim($CONFIG['ecards_more_pic_target'], '/'); $albumpath = "$base/" . $CONFIG['fullpath']; $result = mysql_query("SELECT tb.aid, ta.title FROM {$CONFIG['TABLE_ALBUMS']} tb LEFT OUTER JOIN {$CONFIG['TABLE_ALBUMS']} ta ON tb.aid = ta.aid ORDER BY ta.aid DESC LIMIT 0,3"); while (list($aid, $title) = mysql_fetch_row($result)) { echo "<a href=$base/thumbnails-$aid.html>$title</a><br>"; } ?>
What is your opinion?
Regards from spain
www.sandrailsonly.com/coppermine/rss.php
Used the following code for my rss.php. Placed it in my gallery root and tried to Validate.
<?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
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">";
print "<channel>\n";
print "<title>{$CONFIG['gallery_name']}</title>\n";
print "<link>$base</link>\n";
print "<description>{$CONFIG['gallery_description']}</description>";
print "<language>es-MX</language>\n";
print "<lastBuildDate>" . lmdate(time()) . "</lastBuildDate>\n";
print "<generator>Coppermine RSS 2.0 Generator (1.0)</generator>\n";
$result = mysql_query("SELECT tb.pid,tb.aid,ta.aid,ta.description,tb.ctime,ta.title,tb.keywords,tb.filepath,tb.filename FROM {$CONFIG['TABLE_PICTURES']} tb LEFT OUTER JOIN {$CONFIG['TABLE_ALBUMS']} ta ON tb.aid = ta.aid ORDER BY tb.pid DESC LIMIT 0,$upperlimit");
while (list($pid, $aid,$aaid,$desc, $ctime, $title, $keywords,$filepath,$filename) = mysql_fetch_row($result)) {
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>{$CONFIG['gallery_admin_email']}</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 "<a href=\"$base/displayimage.php?pos=-$pid\">$title</a><br/><br/><br/>$desc<p>$keywords</p>";
print "</description>\n";
print "\t</item>\n";
print "\n";
}
print "</channel>";
print "</rss>";
?>
I get the following errors:
This feed does not validate.
line 6, column 40: lastBuildDate must be an RFC-822 date-time: 2008-02-22T14:46:49-06:00 [help]
<lastBuildDate>2008-02-22T14:46:49-06:00</lastBuildDate> ^In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendation.
line 8, column 0: Missing atom:link with rel="self" [help]
</channel></rss>Source: http://www.sandrailsonly.com/coppermine/rss.php
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel>
<title>Photo & Video Gallery</title>
<link>http://sandrailsonly.com/coppermine</link>
<description>Upload your fav photo; watch killer vids!</description><language>es-MX</language>
<lastBuildDate>2008-02-22T14:46:49-06:00</lastBuildDate>
<generator>Coppermine RSS 2.0 Generator (1.0)</generator>
</channel></rss>
How can I fix this? I tried to fix myself....but then it gave me a parsing error.
Also, it does NOT show up when you visit the site through Mozilla Firefox that there is a feed....
Any help it greatly appreciated. Thanks...
Change
function lmdate($timestamp)
{
if (PHP5){
return date('c', $timestamp);
} else {
return date('D, d M Y H:i:s +0800', $timestamp - date('Z'));
}
}
to
function lmdate($timestamp)
{
return date('r', $timestamp);
}
Here is another code for last upload photos:
<?php
// pepemosca RSS 2.0 Generator
// displays last upload photos via RSS 2.0 feed.
//
// Copyright (c) 2008 pepemosca
//
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$base = rtrim($CONFIG['ecards_more_pic_target'], '/');
// Language and settings
$lan_album = "Foto del &#225;lbum"; //Text before the album name
$lan_archivo = "Nombre de archivo"; //Text before the file name
$lan_descripcion = "Datos de la foto:"; //Picture details
$lan_tamano = "Tamano de la foto"; //Picture size in pixels
$lan_archivotamano = "Tamano del archivo"; //Picture size in bytes
$lan_hits = "Cantidad de veces vista"; //Number of hits, seen times
$lan_rating = "Puntaje de la foto"; //Rating number
$lan_votes1 = "con"; // with...
$lan_votes2 = "votos"; //Votes unit
$cantidad = 10; //How many post to show
// Code
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">\n";
print "<channel>\n";
print "<title>{$CONFIG['gallery_name']} - RSS de los Albumes</title>\n";
print "<link>$base</link>\n";
print "<description>{$CONFIG['gallery_description']}</description>\n";
print "<language>es-AR</language>\n";
print "<category>{$CONFIG['gallery_name']}</category>\n";
print "<lastBuildDate>" . date('D, d M Y H:i:s +0800') . "</lastBuildDate>\n";
print "<copyright>Copyright (c) 2008 pepemosca</copyright>\n";
print "<docs>$base/rss.php</docs>\n";
print "<ttl>10</ttl>\n";
print "<title>{$CONFIG['gallery_name']}</title>\n";
print "<link>$base</link>\n";
//LIMIT 0,*
$result = mysql_query("SELECT pid,aid,filepath,filename,ctime,filesize,hits,pwidth,pheight,pic_rating,votes FROM cpg_pictures ORDER BY pid DESC LIMIT 0,$cantidad");
while(list($pid,$aid,$filepath,$filename,$ctime,$filesize,$hits,$pwidth,$pheight,$pic_rating,$votes) = mysql_fetch_row($result))
{
$result2 = mysql_query("SELECT title FROM cpg_albums WHERE aid=$aid");
list($title) = mysql_fetch_row($result2);
print "\t<item>\n";
print "\t\t<title>$title: $filename</title>\n";
print "\t\t<author>{$CONFIG['gallery_name']}</author>\n";
print "\t\t<link>$base/displayimage.php?pos=-$pid</link>\n";
print "\t\t<description>\n";
print "\t\t<![CDATA[$lan_album "<a href=\"$base/thumbnails.php?album=$aid\">$title</a>".<br/>]]>\n";
print "\t\t<![CDATA[$lan_archivo "<a href=\"$base/displayimage.php?pos=-$pid\">$filename</a>".<br/><br/>]]>\n";
print "\t\t<![CDATA[<a href=\"$base/displayimage.php?pos=-$pid\"><img src=\"$base/albums/$filepath" . "thumb_$filename\" alt=\"\" border=\"0px\" /></a> <br/><br/>]]>\n";
print "\t\t<![CDATA[$lan_descripcion<br/><i>]]>\n";
print "\t\t<![CDATA[$lan_tamano "$pwidth x $pheight".<br/>]]>\n";
print "\t\t<![CDATA[$lan_archivotamano "$filesize bytes".<br/>]]>\n";
print "\t\t<![CDATA[$lan_hits "$hits".<br/>]]>\n";
print "\t\t<![CDATA[$lan_rating "$pic_rating" $lan_votes1 "$votes" $lan_votes2.<br/>]]>\n";
print "\t\t<![CDATA[</i><br/>]]>\n";
print "\t\t</description>\n";
print "\t\t<pubDate>" . date('D, d M Y H:i:s +0800', $ctime - date('Z')) . "</pubDate>\n";
print "\t</item>\n";
}
print "</channel>\n";
print "</rss>";
?>
My photos don't have titles and I don't want the view count or the dates to show in the feed. What should I remove from the code to achieve this and what code should I use to embed the feed on a php page?
I tried to install rss.php and I got this error:
--------------------------------
XML Parsing Error: not well-formed
Location: http://lurrenzinc.com/photos/rss.php
Line Number 11, Column 22: for ( var i = 0; i < links.length; i++ ) {
----------------------------^
------------------------------
The link is http://lurrenzinc.com/photos/rss.php
I need some help
Either remove this 'XWebMenu' stuff or fix it so it doesn't attach itself to the rss feed.
This script worked for me, but didn't really seem "right"... so... i've modified it in the following ways:
- new rss channel for each album
- changed channel name to be album name rather than gallery name
- changed channel description to be album description rather than gallery description
- changed author of each image to be the username of the contributor
- changed image title to be the image title rather than album title
- changed image description to be image description rather than album description
- fixed image descriptions... they just seemed to be a mess
- moved the image keywords to their own element
<?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
// Modified by Richard Pope pope@vatican-uk.com on 15 November 2008
//
// 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
header("Content-type: text/xml; charset=utf-8");
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<rss version=\"2.0\">";
$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 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) = 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</item>\n";
print "\n";
}
print "</channel>";
}
print "</rss>";
Hi.
How can I modify the script to display all files (or x number of files) from the last created album?
Thanks
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>";
To make the above code display a feed for one particular album the following changes can be made.
Replace the following code
$result = mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title ASC");
with
if (isset($_GET['album'])) // just want an RSS feed for one particular album
{
$TheAlbum = (int) $_GET['album']; // first clean the input
$result = mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid=$TheAlbum");
}
else
{
$result = mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} ORDER BY title ASC");
}
Now for example entering rss.php?album=10 will display an RSS feed for just album 10.
Hi,
First of all, am new here so sorry for my questions ^^
I have a coppermine gallery on a site, and we have facebook.
Now i want to combine those two. So is this the solution?
What should i do to make this script work? And where should i upload this file?
grtz
Respect board rules for a start. Read the documentation that comes with cpmFetch. I have no idea how Facebook is related though.
What do you mean whit respect board rules?
Sorry what did i do wrong?
greatings
Greetings to you as well. Board rules (http://forum.coppermine-gallery.net/index.php/topic,55415.0.html) can be found by clicking on the corresponding link in the forum's navigation, or by performing a search.
One of them says that it's mandatory to post a link to your gallery; one of them says that you need to have read the docs before being allowed to post questions. Another one says that you mustn't clutter sticky announcement threads with your inidividual issues. As you can see, you broke several of them. After being told about board rules I find it outrageous to play silly and ask "what board rules", as this shows that you haven't cared to read them.
You agreed to respect board rules when you signed up, and each time you compose a posting a summary of those rules has been displayed for you as well under the heading "Posting rules", inside a big box that tried to grab your attention by using a yellow background and a dashed red border. ::)
Locking.