Advanced search  

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]

Pages: [1]   Go Down

Author Topic: RSS feed images  (Read 7808 times)

0 Members and 1 Guest are viewing this topic.

natrlhy

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
RSS feed images
« 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();
}

?>
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: RSS feed images
« Reply #1 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();
}

?>
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

natrlhy

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: RSS feed images
« Reply #2 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!
Logged

natrlhy

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: RSS feed images
« Reply #3 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
Logged

natrlhy

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: RSS feed images
« Reply #4 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!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.