RSS feed images RSS feed images
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

RSS feed images

Started by natrlhy, December 12, 2007, 04:43:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

natrlhy

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?
<?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();
}

?>

vuud


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


Quote from: 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?
<?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();
}

?>

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

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!

natrlhy

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

natrlhy

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!