forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: natrlhy on December 12, 2007, 04:43:33 pm

Title: RSS feed images
Post by: natrlhy on December 12, 2007, 04:43:33 pm
I'm trying to figure out how to show the image in the feed. I've tried $_thumb after the user settings area but got an error.

How do I get a thumbnail image to appear in the RSS feed?

Where and what would I place in the default rss_lastadded.php file?
Code: [Select]
<?php
//
// cfrssget example file that returns the last added images
//  RELEASE VERSION: 2.0.0
//

$ENABLED true;

if (
$ENABLED) {

        include 
"cfrssget.php";

        
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

        
$rssFeedTitle "FistFullOfCode Photo Gallery";
        
$rssFeedDescription "The last 25 photos added to Fist Full Of Code.";
        
$rssFeedSiteUrl "http://www.xfistfullofcode.com";
        
$rssFeedProviderUrl "http://www.xfistfullofcode.com/cftest/rss_lastadded.php";
        
$rssFeedImageTitle "FFOC Logo";
        
$rssFeedImageURL 'http://www.xfistfullofcode.com/images/ffoc_logo.gif';
        
$rssFeedImageLink "http://www.xfistfullofcode.com";

        
$rssFeedImageAlt "logo";

        
$rssItemTitle "%a :: %t";
        
$rssItemAlternateTitle "%a :: %f";

        
$rssItemDescription "%f from album %a<br/>Filesize %S kb<br/>%c<br/>Rated %V / 5 stars (%v votes total)";
        
$rssItemAlternateDescription "%f from %a<br/>Filesize %S kb<br/>%a: %d<br/>Rated %V / 5 stars (%v votes total)";
        
$totalToShow 5;

///// END OF USER SETTINGS /////////

        
$cfrss = new cfrss();
        
$cfrss->startFeed($rssFeedTitle$rssFeedDescription$rssFeedSiteUrl$rssFeedProviderUrl);
        
$cfrss->setFeedImage($rssFeedImageTitle,$rssFeedImageURL,$rssFeedImageLink,$rssFeedImageAlt);
        
$cfrss->setItemTitle($rssItemTitle,$rssItemAlternateTitle);
        
$cfrss->setItemDescription($rssItemDescription,$rssItemAlternateDescription);
        
$cfrss->addLastAddedMedia($totalToShow);
        
$cfrss->endFeed();
}

?>
Title: Re: RSS feed images
Post by: vuud on December 14, 2007, 12:56:59 am

It's been awhile, but I think you had to basically create an IMG tag in the description part of the RSS feed.

I know I did it early on, but have not done much with it since...


I'm trying to figure out how to show the image in the feed. I've tried $_thumb after the user settings area but got an error.

How do I get a thumbnail image to appear in the RSS feed?

Where and what would I place in the default rss_lastadded.php file?
Code: [Select]
<?php
//
// cfrssget example file that returns the last added images
//  RELEASE VERSION: 2.0.0
//

$ENABLED true;

if (
$ENABLED) {

        include 
"cfrssget.php";

        
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

        
$rssFeedTitle "FistFullOfCode Photo Gallery";
        
$rssFeedDescription "The last 25 photos added to Fist Full Of Code.";
        
$rssFeedSiteUrl "http://www.xfistfullofcode.com";
        
$rssFeedProviderUrl "http://www.xfistfullofcode.com/cftest/rss_lastadded.php";
        
$rssFeedImageTitle "FFOC Logo";
        
$rssFeedImageURL 'http://www.xfistfullofcode.com/images/ffoc_logo.gif';
        
$rssFeedImageLink "http://www.xfistfullofcode.com";

        
$rssFeedImageAlt "logo";

        
$rssItemTitle "%a :: %t";
        
$rssItemAlternateTitle "%a :: %f";

        
$rssItemDescription "%f from album %a<br/>Filesize %S kb<br/>%c<br/>Rated %V / 5 stars (%v votes total)";
        
$rssItemAlternateDescription "%f from %a<br/>Filesize %S kb<br/>%a: %d<br/>Rated %V / 5 stars (%v votes total)";
        
$totalToShow 5;

///// END OF USER SETTINGS /////////

        
$cfrss = new cfrss();
        
$cfrss->startFeed($rssFeedTitle$rssFeedDescription$rssFeedSiteUrl$rssFeedProviderUrl);
        
$cfrss->setFeedImage($rssFeedImageTitle,$rssFeedImageURL,$rssFeedImageLink,$rssFeedImageAlt);
        
$cfrss->setItemTitle($rssItemTitle,$rssItemAlternateTitle);
        
$cfrss->setItemDescription($rssItemDescription,$rssItemAlternateDescription);
        
$cfrss->addLastAddedMedia($totalToShow);
        
$cfrss->endFeed();
}

?>
Title: Re: RSS feed images
Post by: natrlhy on December 14, 2007, 01:18:54 am
If anyone has an example of the IMG tag for the RSS feeds, I'd love to give it a shot in implementing it with my RSS feed testing.

Thanks!
Title: Re: RSS feed images
Post by: natrlhy on December 17, 2007, 09:47:55 am
I've tried adding the following to the rss_lastadded.php file:

 $rssItemDescription = "%f from album %a<br/>%c<br/>Rated %V / 5 stars (%v votes total)<br/> img src="/cfimagege
t.php"";

and I am getting this:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /path/to/rss_lastadded.php on line 28
Title: Re: RSS feed images
Post by: natrlhy on December 17, 2007, 08:48:54 pm
I just updated to the latest cpmfetch 2.1.1 dev build and got it configured. I modified the settings in the // THESE SPECIFY THE INFORMATION USED IN YOUR FEED section and other than that, after updating from 2.0.0 to 2.1.1, I can now see the images in the RSS feed.

Thanks to majfvalk for his IM reply for this tip!