CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH - Page 2 CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH - Page 2
 

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

CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH

Started by vuud, April 27, 2005, 06:58:06 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Philcomputing

Hi,

I still do have problems to use CPMFETCH to generate a feed.
I installed the latest version (copperminefetch-1.4.1) and changed the path to cpm.

rss_lastadded.php


<?php
//
// cfrssget example file that returns the last added images
//
//

$ENABLED =false;

if (
$ENABLED) {

include "cfrssget.php";

$partialurltocpm "/log/shots"; //Part of the URL to CPG without the host and domain

//
// 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($partialurltocpm);
$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();
}

?>





cfrssget.php:



<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.6 $
 *
 * 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.                                       
 * 
 */

error_reporting(E_ALL);
ini_set('display_errors',1);  // 0 is off, 1 is on 
 
include "cpmfetch_dao.php";
include 
"libs/feedcreator.class.php";

$ENABLED false; //Set to false if you will be creating standalone feed modules

if ($ENABLED) {

$partialurltocpm "/log/shots"; //Part of the URL to CPG without the host and domain
$default_command "last"; //What to do if no cmd is specified
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED
  // You only need to use this if you will be using this file as a 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 /////////

$cmd_parameter "last";


if (array_key_exists("cmd",$_GET)) {
switch ($_GET['cmd']) {
case ('mostviewed'):
case ('toprated'):
case ('last'):
case ('random'):
$cmd_parameter $_GET['cmd'];
break;

default:
$cmd_parameter $default_command;
break;
}
} else {
$cmd_parameter $default_command;
}

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

switch ($cmd_parameter) {
case ('mostviewed'):
$cfrss->addMostViewedMedia($totalToShow);
break;
case ('toprated'):
$cfrss->addTopRatedMedia($totalToShow); 
break;
case ('last'):
$cfrss->addLastAddedMedia($totalToShow);
break;
case ('random'):
$cfrss->addRandomMedia($totalToShow);
break;
default:
break;
}

$cfrss->endFeed();
}


////////// The cfrss object itself ///////////////////

class cfrss {

var $cpm "";
var $rss "";
var $urltocpm "";       //from a web client point of view without domain name /photos
var $fullUrlToCpm "";
var $filepathtocpm "";  //server path to cpm directory  /home/vuud/cpm


var $thumbnailprefix "thumb_"
var $intermedprefix "normal_";
var $fullsizeprefix '';
var $defaultimagesize "thumb_";

var $itemTitle "";
var $itemAltTitle "";
var $itemDescription "";
var $itemAltDescription "";

function cfrss ($urltocpm_ "") {
if ($urltocpm_ != "") {

   if (substr($urltocpm_,-1) != '/'$urltocpm_ .= '/';

$this->urltocpm $urltocpm_;
$this->filepathtocpm $_SERVER['DOCUMENT_ROOT'] . $urltocpm_;

if (file_exists($this->filepathtocpm '/include/config.inc.php')) {
include $this->filepathtocpm '/include/config.inc.php';

$this->cpm = new cpm_dao($CONFIG['dbname'], $CONFIG['dbserver'], 
$CONFIG['dbuser'], $CONFIG['dbpass'], $CONFIG['TABLE_PREFIX'], $this->urltocpm);

$this->fullUrlToCpm "http://" $_SERVER['HTTP_HOST'];

$this->cpm->setPhotoPrefix($this->thumbnailprefix$this->intermedprefix$this->fullsizeprefix);

$this->rss = new UniversalFeedCreator();

}
else {
print "ERROR: Path to Coppermine incorrect. (" $this->filepathtocpm ")";
$this "";
}
}
}

function startFeed($title,$description,$link,$syndicationUrl) {
$this->rss->title $title;
$this->rss->description $description;
$this->rss->link $link;
$this->rss->syndicationURL $syndicationUrl;

}

function setFeedImage($imgTitle,$imgUrl,$imglink,$imgDescription) {
$image = new FeedImage();
$image->title $imgTitle;
$image->url $imgUrl;
$image->link $imglink;
$image->description $imgDescription;
$this->rss->image $image
}


function setItemTitle ($pattern,$altpattern="") {
$this->itemTitle $pattern;

if($altpattern == "") { 
$this->itemAltTitle $pattern
} else {
$this->itemAltTitle $altpattern
}
}

function setItemDescription ($pattern,$altpattern="") {
$this->itemDescription $pattern;

if($altpattern == "") { 
$this->itemAltDescription $pattern
} else {
$this->itemAltDescription $altpattern;
}
}

function endFeed( ) {
$this->rss->saveFeed("RSS1.0""./tmp/feed.xml"); 
$this->cpm->destroy();
}

function addLastAddedMedia($count,$source="") {
$results $this->cpm->getLastAddedMediaFrom($source,$count);
$this->generateFeedFromResults($results);
  
}

function addTopRatedMedia($count,$source="") {
$results $this->cpm->getTopRatedMediaFrom($source,$count);
$this->generateFeedFromResults($results);
}

function addMostViewedMedia ($count,$source="") {
$results $this->cpm->getMostVotedMediaFrom($source,$count);
$this->generateFeedFromResults($results);
}

function addRandomMedia ($count,$source="") {
$results $this->cpm->getRandomImageFrom($source,$count);
$this->generateFeedFromResults($results);
}

function 
generateFeedFromResults($results) {

//while ($data = mysql_fetch_assoc($results)) { 
   
foreach ($results as $data) { 

$item = new FeedItem(); 
    

  
$item->link $this->fullUrlToCpm $this->cpm->createLink($data['pFilepath'], rawurlencode($data['pFilename']), $data['pAid'], $data['pPid']);

$titleToUse "";
$descriptionToUse="";

if (($titleToUse $this->cpm->createDescription($this->itemTitle,$data,true)) == false) {
$titleToUse $this->cpm->createDescription($this->itemAltTitle,$data);
}

if (($descriptionToUse $this->cpm->createDescription($this->itemDescription,$data,true)) == false) {
$descriptionToUse $this->cpm->createDescription($this->itemAltDescription,$data);
}

$imagetag '<a href="' $item->link '"><img src="' .  $this->fullUrlToCpm  
$this->cpm->urlEncodeImagePath($this->cpm->getImageToUse($data['pFilepath'],$data['pFilename'], $this->thumbnailprefix)) . '" align="right" /></a>';

$descriptionToUse $imagetag $descriptionToUse;

$item->title $titleToUse;

$item->description $descriptionToUse;
    
    
$item->date date("r",$data['pCtime']);
    
$item->source $this->fullUrlToCpm
    
$item->author $data['pOwner_name']; 
 

$this->rss->addItem($item); 
}

}

// end of class


?>




The file does not contain any entries within the browser only <html><body></body></html>

What do I have to change ?


RSS feed:
http://www.sassen.org/cpmfetch/rss_lastadded.php

Path to CMP:
http://www.sassen.org/cpmfetch/

Path to coppermine:
http://www.sassen.org/log/shots/




vuud

Quote from: Philcomputing on July 16, 2005, 11:20:44 AM
Hi,

I still do have problems to use CPMFETCH to generate a feed.
I installed the latest version (copperminefetch-1.4.1) and changed the path to cpm.

rss_lastadded.php


<?php

$ENABLED 
=false;

?>





Change that to $ENABLED=true;
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

Philcomputing

Hi vuud,

thank you very much!  It works!

The feed can be found under:
http://www.sassen.org/cpmfetch/rss_lastadded.php

Best regards from Berlin,
           Phil




HanOverFist

Phil I tested your feed and I see the fistfulofcode logo reference is still in your script.
So I get a broken image link in the top left corner.
you might want to take that bit out.

Jay

vuud

Quote from: HanOverFist on July 20, 2005, 09:50:16 PM
Phil I tested your feed and I see the fistfulofcode logo reference is still in your script.
So I get a broken image link in the top left corner.
you might want to take that bit out.

Jay

There is in fact a bunch of stuff in that file that can / should be changed... Most of it refers to my site.

Thanks for pointing it out jay
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

HanOverFist

no prob.
nice work on your end.
very cool feature.

Jay

vuud

Quote from: HanOverFist on July 20, 2005, 10:28:08 PM
no prob.
nice work on your end.
very cool feature.

Jay

Thanks... I am sure it can still use more tweaking, but it was my first real foray into RSS - prior to which I really had no idea about it.

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

freesouljah

Hello again :)

I am getting this error:

QuoteWarning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/staticp/public_html/photos/cpmfetch/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.

Warning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/staticp/public_html/photos/cpmfetch/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.


rss_lastadded.php:

<?php
//
// cfrssget example file that returns the last added images
//
//

$ENABLED =true;

if (
$ENABLED) {

include "cfrssget.php";

$partialurltocpm "/photos/"; //Part of the URL to CPG without the host and domain

//
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

$rssFeedTitle "Staticfiends.com Photos";
$rssFeedDescription "The last 25 photos added to Staticfiends.com";
$rssFeedSiteUrl "http://www.staticfiends.com.com/photos";
$rssFeedProviderUrl "http://www.staticfiends.com.com/photos/cpmfetch/rss_lastadded.php";
$rssFeedImageTitle "Staticfiends.com Logo";
$rssFeedImageURL 'http://www.staticfiends.com/favicon.ico';
$rssFeedImageLink "http://www.staticfiends.com.com";


$rssFeedImageAlt "logo";

$rssItemTitle "%a :: %f";
$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 25;

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








cfrssget.php:


<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.5 $
 *
 * 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.                                       
 * 
 */

error_reporting(E_ALL);
ini_set('display_errors',1);  // 0 is off, 1 is on 
 
include "cpmfetch_dao.php";
include 
"libs/feedcreator.class.php";

$ENABLED true; //Set to false if you will be creating standalone feed modules

if ($ENABLED) {

$partialurltocpm "/photos/"; //Part of the URL to CPG without the host and domain
$default_command "last"; //What to do if no cmd is specified
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED
  // You only need to use this if you will be using this file as a feed

$rssFeedTitle "Staticfiends.com Photo Gallery";
$rssFeedDescription "The last 25 photos added to Staticfiends.com";
$rssFeedSiteUrl "http://www.staticfiends.com";
$rssFeedProviderUrl "http://www.staticfiends.com/photos/cpmfetch/rss_lastadded.php";
$rssFeedImageTitle "Staticfiends Logo";
$rssFeedImageURL 'http://www.staticfiends.com/favicon.ico';
$rssFeedImageLink "http://www.staticfiends.com";
$rssFeedImageAlt "logo";

$rssItemTitle "%a :: %f";
$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 25;

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





vuud



Create a directory named tmp in your cpmfetch folder.  Make sure the webserver can write files to it.

That should do it

Sorry

Vuud



Quote from: freesouljah on July 27, 2005, 08:25:56 PM
Hello again :)

I am getting this error:

QuoteWarning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/staticp/public_html/photos/cpmfetch/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.

Warning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/staticp/public_html/photos/cpmfetch/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.


rss_lastadded.php:

<?php
//
// cfrssget example file that returns the last added images
//
//

$ENABLED =true;

if (
$ENABLED) {

include "cfrssget.php";

$partialurltocpm "/photos/"; //Part of the URL to CPG without the host and domain

//
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

$rssFeedTitle "Staticfiends.com Photos";
$rssFeedDescription "The last 25 photos added to Staticfiends.com";
$rssFeedSiteUrl "http://www.staticfiends.com.com/photos";
$rssFeedProviderUrl "http://www.staticfiends.com.com/photos/cpmfetch/rss_lastadded.php";
$rssFeedImageTitle "Staticfiends.com Logo";
$rssFeedImageURL 'http://www.staticfiends.com/favicon.ico';
$rssFeedImageLink "http://www.staticfiends.com.com";


$rssFeedImageAlt "logo";

$rssItemTitle "%a :: %f";
$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 25;

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








cfrssget.php:


<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.5 $
 *
 * 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.                                       
 * 
 */

error_reporting(E_ALL);
ini_set('display_errors',1);  // 0 is off, 1 is on 
 
include "cpmfetch_dao.php";
include 
"libs/feedcreator.class.php";

$ENABLED true; //Set to false if you will be creating standalone feed modules

if ($ENABLED) {

$partialurltocpm "/photos/"; //Part of the URL to CPG without the host and domain
$default_command "last"; //What to do if no cmd is specified
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED
  // You only need to use this if you will be using this file as a feed

$rssFeedTitle "Staticfiends.com Photo Gallery";
$rssFeedDescription "The last 25 photos added to Staticfiends.com";
$rssFeedSiteUrl "http://www.staticfiends.com";
$rssFeedProviderUrl "http://www.staticfiends.com/photos/cpmfetch/rss_lastadded.php";
$rssFeedImageTitle "Staticfiends Logo";
$rssFeedImageURL 'http://www.staticfiends.com/favicon.ico';
$rssFeedImageLink "http://www.staticfiends.com";
$rssFeedImageAlt "logo";

$rssItemTitle "%a :: %f";
$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 25;

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





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

freesouljah

Quote from: vuud on July 27, 2005, 08:30:01 PM


Create a directory named tmp in your cpmfetch folder.  Make sure the webserver can write files to it.

That should do it

Sorry

Vuud



that did it  ;D

no need to apologize...you have done more than enough (and then some)...plus I see the instructions for this in the docs now (I just couldn't understand it -- not the first time that has happened to me...and I doubt it will be the last)

thanks again  8)

vuud

The example, test feed has been moved:

http://www.fistfullofcode.com/php-lib/cpmfetch/rss_lastadded.php

Which may or may not be working depending on the state I have the program in.  I will have a newer development version out this week - will post when it is up with some new instructions on how to play with it.

Sorry to the guy who just tried it :(
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

fferro

How to refresh the image every xx time without refreshing the hole page? thanks

PHPBB 2.0.17
ezPortal 2.1.8



include/page_header.tpl:

..................
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_setReturnType('html');
..................
   'RANDOM_IMAGE' => $objCpm->cpm_viewRandomMediaFromAlbum(1,1,24,array("imagesize" => "large")),
..................
$objCpm->cpm_close();


templates/subSilver/overall_header.tpl:

..................
               <tr>
    <td Valign="top" align="center">{RANDOM_IMAGE}</td>
..................

vuud


I can't think of anyway to do it just with cpmfetch...

Sorry... but post the solution if you find one...  Maybe something with CSS Layers or something?




Quote from: fferro on September 02, 2005, 12:03:13 PM
How to refresh the image every xx time without refreshing the hole page? thanks

PHPBB 2.0.17
ezPortal 2.1.8



include/page_header.tpl:

..................
include "../cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_setReturnType('html');
..................
   'RANDOM_IMAGE' => $objCpm->cpm_viewRandomMediaFromAlbum(1,1,24,array("imagesize" => "large")),
..................
$objCpm->cpm_close();


templates/subSilver/overall_header.tpl:

..................
               <tr>
    <td Valign="top" align="center">{RANDOM_IMAGE}</td>
..................
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

fferro

Quote from: vuud on September 05, 2005, 05:29:04 AM

I can't think of anyway to do it just with cpmfetch...

Sorry... but post the solution if you find one...  Maybe something with CSS Layers or something

may be something like this:

method 1= (inside the .php file, just before the cpmfetch call):
<meta http-equiv="refresh" content="60;url=your_page.php">

method 2= (inside the .tpl file):
<script language="JavaScript">
<!--
setTimeout('location.href = location.href',1000*60);
//-->
</script>

this one refresh my phpbb2 portal page (with my cpmfetch image) every minute, but the hole page.

pneurosys

Hey vuud, great job and thanks  ;)

I was wondering if it's there a way to make a feed with the latest albums added instead of the latest pictures, It would be great for my site because I add a lot of albums daily, Thanks ;)

vuud

Quote from: pneurosys on October 19, 2005, 06:21:27 PM
Hey vuud, great job and thanks  ;)

I was wondering if it's there a way to make a feed with the latest albums added instead of the latest pictures, It would be great for my site because I add a lot of albums daily, Thanks ;)

Not specifically, but if you check out cfrssget.php you can see where the different reports are created by name (lines 188-208).  You can maybe just add a new one to do what you want.  Maybe.

My life has been in an uproar (not bad or anything) just very unsettled so I have not had real time to devote to this lately.

Sorry, but let me know if you try something...
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

Colegota

Hi!

First at all, thank you for your work with cpmfech (and cpg, of course). Sorry to answer here but I can find a "new topic" button.

I'm trying to change a little the rss for our gallery. There is for a travellers comunity so we usually upload a lot of images togheter in a single album. The actual rss_lastadded.php reflects all photos in the feed.
I'd like to have in the feed just one entry for each album updated with the image of the last photo added to album. We have a syndicated system with wordpress where the main page is feeded with the entries of our individual travel pages. Now, it will be fine if we can feed also that main page with the updates in the CPG gallery.

I've take a look to docs and try some hacks, but It does not work.

I'd like to use the function showAlbumsUpdatedOverLastDays() instead of addLastAddedMedia()in the rss, but I believe the first one is not designed for it.

I've try to put in rss_image_albums.php (my version of rss_lastadded.php)

<?php
//
// cfrssget example file that returns the last added images
//  RELEASE VERSION: 1.6.2
//

$ENABLED =true;

if (
$ENABLED) {

include "cfrssget.php";

$partialurltocpm "/"; //Part of the URL to CPG without the host and domain

//
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

$rssFeedTitle "La Descripción del Mundo";
$rssFeedDescription "Últimos albumes actualizados en http://www.mapamundi.org";
$rssFeedSiteUrl "http://www.mapamundi.org";
$rssFeedProviderUrl "http://www.mapamundi.org/rss_imagenes_albums.php";
$rssFeedImageTitle "Logo";
$rssFeedImageURL 'http://mapamundi.info/wp-content/themes/parishuddha-mmi/mapaboton.jpg';
$rssFeedImageLink "http://www.mapamundi.org";

$rssFeedImageAlt "logo";

$rssItemTitle "Nuevas fotos en %a por %o";
$rssItemAlternateTitle "Nuevas fotos en %a por %o";

$rssItemDescription "%c<br/>%C<br/>Última foto %f<br/>Tamaño %S kb";
$rssItemAlternateDescription "%c<br/>%C<br/>Última foto %f<br/>Tamaño %S kb";
$totalToShow 1;

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

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

?>



And also in  cfrssget.php


switch ($cmd_parameter) {
case ('mostviewed'):
$cfrss->addMostViewedMedia($totalToShow);
break;
case ('toprated'):
$cfrss->addTopRatedMedia($totalToShow);
break;
case ('last'):
$cfrss->addLastAddedMedia($totalToShow);
break;
case ('random'):
$cfrss->addRandomMedia($totalToShow);
break;
default:
$cfrss->showAlbumsUpdatedOverLastDays($totalToShow);
break;
}


BTW I'm not kind in rss, but why is needed to duplicate code between rss_last_added.php and cfrssget.php? I've changed titles and descriptions in the first one but feed always shows the ones in cfrssget.php

Thank you a lot for all.

Best regards,
Colegota

vuud


The newtopic is disabled intentionally. 

Anyway, I think you are going to have to combine creating your own data with the existing rss construction.  There was a hack floating around here to create the last image from each gallery, but integrating it will bea bit of a pain.  Let me see if I can look at it later today.  emphasis on "see if I can"... its going to be a busy day.


Quote from: Colegota on November 26, 2005, 07:49:50 PM
Hi!

First at all, thank you for your work with cpmfech (and cpg, of course). Sorry to answer here but I can find a "new topic" button.

I'm trying to change a little the rss for our gallery. There is for a travellers comunity so we usually upload a lot of images togheter in a single album. The actual rss_lastadded.php reflects all photos in the feed.
I'd like to have in the feed just one entry for each album updated with the image of the last photo added to album. We have a syndicated system with wordpress where the main page is feeded with the entries of our individual travel pages. Now, it will be fine if we can feed also that main page with the updates in the CPG gallery.

I've take a look to docs and try some hacks, but It does not work.

I'd like to use the function showAlbumsUpdatedOverLastDays() instead of addLastAddedMedia()in the rss, but I believe the first one is not designed for it.

I've try to put in rss_image_albums.php (my version of rss_lastadded.php)

<?php
//
// cfrssget example file that returns the last added images
//  RELEASE VERSION: 1.6.2
//

$ENABLED =true;

if (
$ENABLED) {

include "cfrssget.php";

$partialurltocpm "/"; //Part of the URL to CPG without the host and domain

//
// THESE SPECIFY THE INFORMATION USED IN YOUR FEED

$rssFeedTitle "La Descripción del Mundo";
$rssFeedDescription "Últimos albumes actualizados en http://www.mapamundi.org";
$rssFeedSiteUrl "http://www.mapamundi.org";
$rssFeedProviderUrl "http://www.mapamundi.org/rss_imagenes_albums.php";
$rssFeedImageTitle "Logo";
$rssFeedImageURL 'http://mapamundi.info/wp-content/themes/parishuddha-mmi/mapaboton.jpg';
$rssFeedImageLink "http://www.mapamundi.org";

$rssFeedImageAlt "logo";

$rssItemTitle "Nuevas fotos en %a por %o";
$rssItemAlternateTitle "Nuevas fotos en %a por %o";

$rssItemDescription "%c<br/>%C<br/>Última foto %f<br/>Tamaño %S kb";
$rssItemAlternateDescription "%c<br/>%C<br/>Última foto %f<br/>Tamaño %S kb";
$totalToShow 1;

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

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

?>



And also in  cfrssget.php


switch ($cmd_parameter) {
case ('mostviewed'):
$cfrss->addMostViewedMedia($totalToShow);
break;
case ('toprated'):
$cfrss->addTopRatedMedia($totalToShow);
break;
case ('last'):
$cfrss->addLastAddedMedia($totalToShow);
break;
case ('random'):
$cfrss->addRandomMedia($totalToShow);
break;
default:
$cfrss->showAlbumsUpdatedOverLastDays($totalToShow);
break;
}


BTW I'm not kind in rss, but why is needed to duplicate code between rss_last_added.php and cfrssget.php? I've changed titles and descriptions in the first one but feed always shows the ones in cfrssget.php

Thank you a lot for all.

Best regards,
Colegota

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

Colegota

Hi!

Quote from: vuud on November 26, 2005, 08:08:44 PM
Anyway, I think you are going to have to combine creating your own data with the existing rss construction.

Well, really, I just want to have an rss of last albums updated (or created) instead of last images added.

Thanks for your fast answer.
Colegota

vuud

Quote from: Colegota on November 26, 2005, 08:34:26 PM
Hi!

Quote from: vuud on November 26, 2005, 08:08:44 PM
Anyway, I think you are going to have to combine creating your own data with the existing rss construction.

Well, really, I just want to have an rss of last albums updated (or created) instead of last images added.

Thanks for your fast answer.
Colegota


Hmmm, so you would just want them in decending order (newest to oldest) up to the total amount to return on the feed? 

Or based on the number of days?  So the feed would show new over the last "50", or whatever number, of days?

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