coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Stevo on June 02, 2009, 10:17:51 PM

Title: [Closed]: RSS
Post by: Stevo on June 02, 2009, 10:17:51 PM
Found this RSS code on the internet.
But in Feedreader 3.14 you can see name and date under picture (see attachment)

Is it possible to have some space between name vessel and date??
Can I also put custom fields in this code?


//Changes these to point to your site if the following is not giving correct results.
$link_url = $CONFIG['ecards_more_pic_target']."displayimage.php?pos=-";
$image_url = $CONFIG['ecards_more_pic_target']."albums/";


$data = get_pic_data($album, $thumb_count, $album_name, $lower_limit, $thumb_per_page);


header ("content-type: text/xml");
//maybe you must change the encoding to iso-8859-1.
$rssHeader = <<<EOT
<?xml version="1.0" encoding="iso-8859-7"?>
<rss version="2.0"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
>
<channel>
   <title>$CONFIG[gallery_name]</title>
   <link>$CONFIG[ecards_more_pic_target]</link>
   <description>$CONFIG[gallery_description] - $album_name</description>
   <generator>http://www.stevo.be/rss.php</generator>
EOT;
echo $rssHeader;

foreach($data AS $picture) {

   $thumb_url = "$image_url$picture[filepath]$CONFIG[pfx]$picture[filename]";
   $keywords = explode(" ",trim($picture[keywords]));
   $category_string = "";
   foreach($keywords as $keyword){
        $category_string .= "<category>$keyword</category>";
   }
   $pubDate = gmdate("D, d M Y H:i:s", $picture[ctime]);
   
   $description = '<a href="' . $link_url . $picture['pid'] . '"><img src="' . $thumb_url . '" border="0" vspace="2" hspace="2"> <align="center" ></a><br>'.bb_decode($picture[caption]).bb_decode($picture[caption_text]);    
   $description =  htmlspecialchars($description);
   
   $item = '<item>
             <title>'.$picture[title].'</title>
             <link>' . $link_url . $picture[pid] . '</link>
             <pubDate>' .$pubDate.' EST</pubDate>                    
         '.$category_string.'
             <description>'.$description.'</description>          
            </item>';

   echo $item;
}

$rssFooter = <<<EOT
</channel>
</rss>
EOT;
echo $rssFooter;

?>
Title: Re: RSS
Post by: Joachim Müller on June 03, 2009, 07:55:29 AM
In which aspect is this related to coppermine? What's the link to your coppermine-driven gallery?
Title: Re: RSS
Post by: Stevo on June 03, 2009, 10:28:47 AM
this is an rss feed I found on the internet and it works with coppermine.

http://www.stevo.be
Title: Re: RSS
Post by: Joachim Müller on June 03, 2009, 10:31:00 AM
So the mod pulls data from coppermine and displays it on a non-coppermine-driven page? Then you need to edit the non-coppermine page. Beyond the scope of support here.
Title: Re: [Closed]: RSS
Post by: Stevo on June 03, 2009, 07:32:18 PM
Sorry, thought this was writing for coppermine.


// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery - RSS Feed                                      //
// ------------------------------------------------------------------------- //
// Copyright (C) Dr. Tarique Sani                                           //
// http://tariquesani.net/                                                  //
// modifications by versus7 - www.oixalia.gr - oixalia@oixalia.gr //
// 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.                                      //
// ------------------------------------------------------------------------- //
// Just put into the same directory as your coppermine installation         //
// ------------------------------------------------------------------------ //
Title: Re: RSS
Post by: Joachim Müller on June 04, 2009, 11:35:25 AM
Quote from: Stevo on June 03, 2009, 10:28:47 AM
I found on the internet
You should have posted where you found it in the first place.
It's a mod - it's up to the mod author to support it. However, it hasn#T been written for a supported version of coppermine afaik.