Get RSS Feeds from Coppermine now!( shows album's title and descriptions) Get RSS Feeds from Coppermine now!( shows album's title and descriptions)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Get RSS Feeds from Coppermine now!( shows album's title and descriptions)

Started by wieland, September 30, 2006, 06:29:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

wieland

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

Sami

‍I don't answer to PM with support question
Please post your issue to related board

wieland

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

Sami

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
‍I don't answer to PM with support question
Please post your issue to related board

Dead J. Dona

wbr, Me. Dead J. Dona

Sami

‍I don't answer to PM with support question
Please post your issue to related board

cornelp

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...

Sami

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 don't answer to PM with support question
Please post your issue to related board

cornelp

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

Sami

Sorry but it seems it's not well-formed and didn't work with some Servers
‍I don't answer to PM with support question
Please post your issue to related board

cornelp

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.

danyel

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.


Nibbler


danyel

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

danyel

 ??? 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.

imrich

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.

Nibbler

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.

Aeronautic

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.

The feed url is here.

Wondering if the Paypal mod is to blame? Any ideas? Thanks!

Aeronautic

Quote from: Aeronautic on December 23, 2006, 02:40:23 AM
The feed url is here.

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!


pacimir

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 :)