forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: vuud on April 27, 2005, 06:58:06 am

Title: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on April 27, 2005, 06:58:06 am
With the 1.2 version of cpmFetch, I began to include some basic RSS functionality uses the background library that is the core of the cpmfetch library. 

I am putting some effort into finishing it over the next week.  What does everyone want in this sort of functionality?  My first implementation is showing the last added with thumbnails, links and description.

My test feed is at

UPDATE:
The file is now at this location... if you get a blank screen its because I released a new version and forgot to re-enable it.  Curses
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.

When its where I think it is nice, useful and stable - a new stable version of cpmfetch will be released.

I am also not a guru with RSS so if anyone has comments or suggestions or something I missed, please help by letting me know :D


Thanks much,

Vuud








Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Tarique Sani on April 27, 2005, 07:03:52 am
Great work! now I need not worry about looking into the older rss mod which was there... as long as the feed outputted validates you should be fine :)
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on April 27, 2005, 07:32:48 am
Great work! now I need not worry about looking into the older rss mod which was there... as long as the feed outputted validates you should be fine :)

No problem...  The feed WILL validate (if not now, before its stable) - I'm big on matching standards.

Glad your not unhappy about this :)

BTW: I checked some of your photos out while figuring out some of the RSS stuff - exceptional stuff!   My favorite is the lizard with the mantis...  what timing to be there for that also (unless you provided the mantis).   My problem with my digital is that I cannot add on extender lenses to do real close up work.  Oh well.

If you have any suggestions along the way - please don't hesistate to tell me.  Also if it sucks, you can tell me that too (at least include why)

Later


Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Tarique Sani on April 27, 2005, 08:04:09 am
Glad your not unhappy about this :)
Why should I be :) 

Anyone who lessens my workload is most welcome, thanks for the compliments on the pictures - About the mantis and Calotes - read more at http://www.livejournal.com/users/tariquesani/134239.html if interested.
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on April 28, 2005, 08:19:51 am
Notifications of new releases. 

I added a sign up to my site for email notifications of new updates to cpmfetch.

See the site at:

http://www.fistfullofcode.com/projects/copperminefetch/index.php

A little ways down the page there is a signup entry.

I won't give away email addresses or bombard you with crap.  Just emails every once in awhile announcing new versions and features and stuff.


Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on April 30, 2005, 08:56:23 am
Well, I am darned near done with the RSS feed.  :D Right now its set to RSS 1.0, but RSS0.91, RSS1.0, RSS2.0, PIE0.1,
MBOX, OPML, ATOM, ATOM0.3 should all be working.  Although I have not done much with any of them.  Who knows.  Something I will need to try.


Try this feed: http://www.fistfullofcode.com/cftest/rss_lastadded.php

The entries should look like so in your reader... if not, please send me a screenshot or very vivid description. 
There is also a FFOC logo at the top and the image of the photo on the right.

Code: [Select]
Feed:cpmfetch: rss_lastadded.php
Item:Night photography :: img_1898.jpg

img_1898.jpg from Night photography
Filesize 91.2 kb
Night photography: Getting workable photos in very dark situations is not
as easy as one might think. Unless you just want the foreground you can not use
a flash. If you don't have a flash, a tripod is a must. Sometimes you can get away with
holding the camera on something or bracing your arms.

Rated 5 / 5 stars (1 votes total)

date 04/15/05 23:55:21
creator adminZero

I am close... I want a few more tags in there, and also to test the validation.  But if anyone can try it in differnt readers, that would be splendid.  I run Liferea.



Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Joachim Müller on April 30, 2005, 05:52:08 pm
I'm sure you already checked, but anyway: your feed validates! (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.fistfullofcode.com%2Fcftest%2Frss_lastadded.php) ;D
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on May 01, 2005, 06:02:15 am
I'm sure you already checked, but anyway: your feed validates! (http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fwww.fistfullofcode.com%2Fcftest%2Frss_lastadded.php) ;D

Did not really check it, but my feedreader stopped complaining...

Good to hear!

Thanks :D
Title: New Dev release up 1.3.3 - Now with RSS
Post by: vuud on May 02, 2005, 08:58:18 am
CpmFetch Announcements from FistFullOfCode.com
[The exact Center of the Internet]

--------------------------------------------------------------
Sign up for email notifications at http://cpmfetch.fistfullofcode.com

This will get you:
* Emails for new releases and development releases
* Notifications of new tutorials and online help
* Security notification (if we ever have one)
* Email addresses held closely - no spam, not shared
----------------------------------------------------------------

* * * Development release 1.3.3 is ONLINE now * * *
( get it at http://cpmfetch.fistfullofcode.com/downloads.php )

I have just posted a new development release online for people to play
with.  Some neat new stuff is in there, along with the first test RSS feed
generator.

All the changes since the last dev release are:

* cfrssget.php and rss_lastadded.php added for RSS Feeds
* Documentation page for RSS Feeder started
* Cleaned up SQL code in the DAO, added some new parameters
* function cpm_viewTopRatedMediaFrom ($source, $rows, $columns, $options) 
* function cpm_viewMostVotedMediaFrom ($source,  $rows, $columns, $options)
* add %v for tags to show total votes
* add %V for tags to show current rating
* function cpm_listMediaCountFrom($source) to get media count for a given area of the database
* BugFix: $source was not recognizing uppercase album and cat keywords

 ??? But what does that mean?

* cfrssget.php and rss_lastadded.php added for RSS Feeds

This is my first public run at an RSS feed generator.   See the docs online or in your
distribution for how to get it to work.

* Cleaned up SQL code in the DAO, added some new parameters

This was for me... getting a bit cluttered in there.  Some internal improvements.

* function cpm_viewTopRatedMediaFrom ($source, $rows, $columns, $options)

Shows the photos with the highest score as held internally by the cpg database
 
* function cpm_viewMostVotedMediaFrom ($source,  $rows, $columns, $options)

Shows the photos that were voted on the most.

* add %v for tags to show total votes

This is for the format strings...  Displays total votes for a displayed image

* add %V for tags to show current rating

This is for the format strings... Shows how many stars this has for a rating

* function cpm_listMediaCountFrom($source) to get media count for a given area of the database

Allows you to get how many media items are in a given source range.

* BugFix: $source was not recognizing uppercase album and cat keywords

Yeah, $source would not recognize Album as album.  All better now.
-------------------------------------------------------------------------------------------------------








Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on May 10, 2005, 07:40:05 am
Well, 1.3.4 is out... no changes to RSS there.

I added in tonight code for getting the toprated and most viewed media.

So now, I really have the lastadded and the two above.

What more does anyone seek in an RSS solution?

I am pretty much out of ideas for what to add...  So unless someone suggests something else for it, not many more features will be added...

So tell me what its missing :P
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Philcomputing on May 28, 2005, 12:00:07 pm
It seems that I am very stupid today.
I created a rss feed based on CMP. Unfortunately I do not see the images within the feed. I do only see the name of the file.

Thank you in advance, Cheers Phil

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/

cfrssget.php:
Code: [Select]
<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.1 $
 *
 * 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 "coppermine_dao.php";
include 
"libs/feedcreator.class.php";

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

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

$DEBUG true;

/*

if ($AllowDirectFeed) {
$cfrss = new cfrss($partialurltocpm);


$cfrss->startFeed("RSS Test title","Pictures from the Geekside",
"http://www.fistfullofcode.com","http://www.fistfullofcode.com/cftest/cfrssget.php");

$cfrss->setFeedImage("FFOC Logo",'http://www.fistfullofcode.com/images/ffoc_logo.gif',"http://www.fistfullofcode.com","logo");

$cfrss->addLastAddedMedia(50);

$cfrss->endFeed();


}
*/

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

class cfrss {

var $cpm "";
var $rss "";
var $urltocpm "./log/shots/albums/";       //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_ != "") {
$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""feed.xml"); 
$this->cpm->destroy();
}


//' p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title as pTitle, p.caption AS pCaption, //  p.owner_name AS pOwner_name, p.ctime AS pCtime, p.hits AS pHits, a.title as aTitle, a.description AS aDescription, p.pid AS pPid '

function addLastAddedMedia($count) {
$results $this->cpm->getLastAddedMedia($count);

while ($data mysql_fetch_assoc($results)) { 
    
$item = new FeedItem(); 
    
//$item->link = $data['pFilepath'] . $data['pFilename']; 
  
$item->link $this->fullUrlToCpm $this->cpm->createLink($data['pFilepath'], $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);
}

$item->title $titleToUse;
$item->description $descriptionToUse;
    
$rssFeedImageTitle "FFOC Logo";
$rssFeedImageURL 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
$rssFeedImageLink "http://www.fistfullofcode.com";
$rssFeedImageAlt "logo";

//  $image = new FeedImage();
//  $image->title = "FFOC Logo";
//  $image->url = 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
//  $image->link = "http://www.fistfullofcode.com";
//  $image->description = "logo";
//  $item->image = $image; 


    
//optional
    
//item->descriptionTruncSize = 500;
    
//item->descriptionHtmlSyndicated = true;

    
$item->date $data['pCtime']; 
    
$item->source "http://www.sassen.org"
    
$item->author "Phil von Sassen"
 

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

}

// end of class


?>


rss_lastadded.php:
Code: [Select]
<?php
//
// cfrssget example file that returns the last added images
//
// THIS ASSUMES YOU HAVE cfrssget.php CONFIGURED.  
//

$ENABLED true;


$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.fistfullofcode.com";
$rssFeedProviderUrl "http://www.fistfullofcode.com/cftest/rss_lastadded.php";
$rssFeedImageTitle "FFOC Logo";
$rssFeedImageURL 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
$rssFeedImageLink "http://www.fistfullofcode.com";
$rssFeedImageAlt "logo";
$rssItemTitle "%t";
$rssItemAlternateTitle "%p %f";
$rssItemDescription "From my album titled %a (%d)";
$rssItemAlternateDescription "%p%f";
$totalToShow 5;


///// END OF USER SETTINGS /////////
include "cfrssget.php";

if (
$ENABLED) {
$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();
}

?>


Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on May 28, 2005, 05:06:08 pm

Hi Phil,

In $partialurltocpm = "./log/shots/"

Try removing the period from the ./log

It should just be /log/shots

Methinks that will help!

Vuud



It seems that I am very stupid today.
I created a rss feed based on CMP. Unfortunately I do not see the images within the feed. I do only see the name of the file.

Thank you in advance, Cheers Phil

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/

cfrssget.php:
Code: [Select]
<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.1 $
 *
 * 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 "coppermine_dao.php";
include 
"libs/feedcreator.class.php";

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

$partialurltocpm "./log/shots/"; //Part of the URL to CPG without the host and domain
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Philcomputing on May 29, 2005, 10:44:03 am
Did the change and receive the following result:

Code: [Select]
<!-- generator="FeedCreator 1.7.2" -->
-
<rdf:RDF>
-
<channel rdf:about="http://www.fistfullofcode.com/cftest/rss_lastadded.php">
<title>Phil pictures of the Geekside</title>
-
<description>
The last 25 photos added to Phil tales from the geekside
</description>
<link>http://www.sassen.org</link>
<image rdf:resource="http://www.fistfullofcode.com/images/ffoc_logo.gif"/>
<dc:date>2005-05-29T10:38:59+01:00</dc:date>
-
<items>
-
<rdf:Seq>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-603"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-598"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-599"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-600"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-601"/>
</rdf:Seq>
</items>
</channel>
-
<image rdf:about="http://www.fistfullofcode.com/images/ffoc_logo.gif">
<title>FFOC Logo</title>
<link>http://www.sassen.org</link>
<url>http://www.fistfullofcode.com/images/ffoc_logo.gif</url>
</image>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-603">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>userpics/10001/ ahoi_05.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-603
</link>
<description>userpics/10001/ahoi_05.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-598">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_016.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-598
</link>
<description>max/max_016.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-599">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_017.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-599
</link>
<description>max/max_017.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-600">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_018.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-600
</link>
<description>max/max_018.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-601">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_019.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-601
</link>
<description>max/max_019.jpg</description>
</item>
</rdf:RDF>

Instead of a thumbnail I reice the name of the image eg: "userpics/10001/ ahoi_05.jpg"
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on May 29, 2005, 08:12:46 pm

Are you sure you removed the . from ./log ?

Just asking because it still seems to be there...

Which file did you remove it from? 



Did the change and receive the following result:

Code: [Select]
<!-- generator="FeedCreator 1.7.2" -->
-
<rdf:RDF>
-
<channel rdf:about="http://www.fistfullofcode.com/cftest/rss_lastadded.php">
<title>Phil pictures of the Geekside</title>
-
<description>
The last 25 photos added to Phil tales from the geekside
</description>
<link>http://www.sassen.org</link>
<image rdf:resource="http://www.fistfullofcode.com/images/ffoc_logo.gif"/>
<dc:date>2005-05-29T10:38:59+01:00</dc:date>
-
<items>
-
<rdf:Seq>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-603"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-598"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-599"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-600"/>
<rdf:li rdf:resource="http://www.sassen.org./log/shots/displayimage.php?pos=-601"/>
</rdf:Seq>
</items>
</channel>
-
<image rdf:about="http://www.fistfullofcode.com/images/ffoc_logo.gif">
<title>FFOC Logo</title>
<link>http://www.sassen.org</link>
<url>http://www.fistfullofcode.com/images/ffoc_logo.gif</url>
</image>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-603">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>userpics/10001/ ahoi_05.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-603
</link>
<description>userpics/10001/ahoi_05.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-598">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_016.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-598
</link>
<description>max/max_016.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-599">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_017.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-599
</link>
<description>max/max_017.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-600">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_018.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-600
</link>
<description>max/max_018.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org./log/shots/displayimage.php?pos=-601">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>max/ max_019.jpg</title>
-
<link>
http://www.sassen.org./log/shots/displayimage.php?pos=-601
</link>
<description>max/max_019.jpg</description>
</item>
</rdf:RDF>

Instead of a thumbnail I reice the name of the image eg: "userpics/10001/ ahoi_05.jpg"
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Philcomputing on May 29, 2005, 11:54:22 pm
Thank you very much for trying to help me.
Unfortunately I was not able to solve the problem...  :\'(

Enclosed the code I changed:


cfrssget.php
Code: [Select]
<?php 
/**
 * cfrssget.php
 * 
 * @version $Revision: 1.1 $
 *
 * 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 "coppermine_dao.php";
include 
"libs/feedcreator.class.php";

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

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

$DEBUG true;

/*

if ($AllowDirectFeed) {
$cfrss = new cfrss($partialurltocpm);


$cfrss->startFeed("RSS Test title","Pictures from the Geekside",
"http://www.fistfullofcode.com","http://www.fistfullofcode.com/cftest/cfrssget.php");

$cfrss->setFeedImage("FFOC Logo",'http://www.fistfullofcode.com/images/ffoc_logo.gif',"http://www.fistfullofcode.com","logo");

$cfrss->addLastAddedMedia(50);

$cfrss->endFeed();


}
*/

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

class cfrss {

var $cpm "";
var $rss "";
var $urltocpm "/log/shots/";       //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_ != "") {
$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""feed.xml"); 
$this->cpm->destroy();
}


//' p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title as pTitle, p.caption AS pCaption, //  p.owner_name AS pOwner_name, p.ctime AS pCtime, p.hits AS pHits, a.title as aTitle, a.description AS aDescription, p.pid AS pPid '

function addLastAddedMedia($count) {
$results $this->cpm->getLastAddedMedia($count);

while ($data mysql_fetch_assoc($results)) { 
    
$item = new FeedItem(); 
    
//$item->link = $data['pFilepath'] . $data['pFilename']; 
  
$item->link $this->fullUrlToCpm $this->cpm->createLink($data['pFilepath'], $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);
}

$item->title $titleToUse;
$item->description $descriptionToUse;
    
$rssFeedImageTitle "FFOC Logo";
$rssFeedImageURL 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
$rssFeedImageLink "http://www.fistfullofcode.com";
$rssFeedImageAlt "logo";

//  $image = new FeedImage();
//  $image->title = "FFOC Logo";
//  $image->url = 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
//  $image->link = "http://www.fistfullofcode.com";
//  $image->description = "logo";
//  $item->image = $image; 


    
//optional
    
//item->descriptionTruncSize = 500;
    
//item->descriptionHtmlSyndicated = true;

    
$item->date $data['pCtime']; 
    
$item->source "http://www.sassen.org"
    
$item->author "Phil von Sassen"
 

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

}

// end of class


?>



rss_lastadded.php
Code: [Select]
:
<?php
//
// cfrssget example file that returns the last added images
//
// THIS ASSUMES YOU HAVE cfrssget.php CONFIGURED.  
//

$ENABLED true;


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

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

$rssFeedTitle "Phil pictures of the Geekside";
$rssFeedDescription "The last 25 photos added to Phil tales from the geekside";
$rssFeedSiteUrl "http://www.sassen.org";
$rssFeedProviderUrl "http://www.fistfullofcode.com/cftest/rss_lastadded.php";
$rssFeedImageTitle "FFOC Logo";
$rssFeedImageURL 'http://www.fistfullofcode.com/images/ffoc_logo.gif';
$rssFeedImageLink "http://www.sassen.org";
$rssFeedImageAlt "logo";
$rssItemTitle "%t";
$rssItemAlternateTitle "%p %f";
$rssItemDescription "From my album titled %a (%d)";
$rssItemAlternateDescription "%p%f";
$totalToShow 5;


///// END OF USER SETTINGS /////////
include "cfrssget.php";

if (
$ENABLED) {
$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();
}

?>


feed.xml

Code: [Select]
<!-- generator="FeedCreator 1.7.2" -->
-
<rdf:RDF>
-
<channel rdf:about="http://www.fistfullofcode.com/cftest/rss_lastadded.php">
<title>Phil pictures of the Geekside</title>
-
<description>
The last 25 photos added to Phil tales from the geekside
</description>
<link>http://www.sassen.org</link>
<image rdf:resource="http://www.fistfullofcode.com/images/ffoc_logo.gif"/>
<dc:date>2005-05-29T23:47:13+01:00</dc:date>
-
<items>
-
<rdf:Seq>
<rdf:li rdf:resource="http://www.sassen.org/log/shots/displayimage.php?pos=-609"/>
<rdf:li rdf:resource="http://www.sassen.org/log/shots/displayimage.php?pos=-608"/>
<rdf:li rdf:resource="http://www.sassen.org/log/shots/displayimage.php?pos=-607"/>
<rdf:li rdf:resource="http://www.sassen.org/log/shots/displayimage.php?pos=-604"/>
<rdf:li rdf:resource="http://www.sassen.org/log/shots/displayimage.php?pos=-605"/>
</rdf:Seq>
</items>
</channel>
-
<image rdf:about="http://www.fistfullofcode.com/images/ffoc_logo.gif">
<title>FFOC Logo</title>
<link>http://www.sassen.org</link>
<url>http://www.fistfullofcode.com/images/ffoc_logo.gif</url>
</image>
-
<item rdf:about="http://www.sassen.org/log/shots/displayimage.php?pos=-609">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>userpics/10001/ ahoi_05.jpg</title>
-
<link>
http://www.sassen.org/log/shots/displayimage.php?pos=-609
</link>
<description>[color=Red]userpics/10001/ahoi_05.jpg[/color]</description>
</item>
-
<item rdf:about="http://www.sassen.org/log/shots/displayimage.php?pos=-608">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>rg/ ahoi_005.jpg</title>
-
<link>
http://www.sassen.org/log/shots/displayimage.php?pos=-608
</link>
<description>rg/ahoi_005.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org/log/shots/displayimage.php?pos=-607">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>rg/ ahoi_003.jpg</title>
-
<link>
http://www.sassen.org/log/shots/displayimage.php?pos=-607
</link>
<description>rg/ahoi_003.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org/log/shots/displayimage.php?pos=-604">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>rg/ ahoi_001.jpg</title>
-
<link>
http://www.sassen.org/log/shots/displayimage.php?pos=-604
</link>
<description>rg/ahoi_001.jpg</description>
</item>
-
<item rdf:about="http://www.sassen.org/log/shots/displayimage.php?pos=-605">
<dc:format>text/html</dc:format>
<dc:date>1970-01-01T00:00:00+01:00</dc:date>
<dc:source>http://www.sassen.org</dc:source>
<dc:creator>Phil von Sassen</dc:creator>
<title>rg/ ahoi_002.jpg</title>
-
<link>
http://www.sassen.org/log/shots/displayimage.php?pos=-605
</link>
<description>rg/ahoi_002.jpg</description>
</item>
</rdf:RDF>
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on May 31, 2005, 11:20:41 pm
Thank you very much for trying to help me.
Unfortunately I was not able to solve the problem...  :\'(

Enclosed the code I changed:


Phil, I am befuddled.  I cannot see anyway the code could produce that.  If its got photos, it should at least be generating a bad Link or something... but yours is not. 

I am releasing version 1.3.5 in the next day or two... I suggest trying that as I have revamped some of the code in there.

I don't understand how its not doing it - so I may be looking at newer code.

In any case, let me know how the new version goes (and make sure to upgrade all the files)




Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Philcomputing on June 01, 2005, 08:43:28 am
Hi vuud,

thank you once again for your kind help and supporting actions  :P

Best regards from Berlin - Germany, Phil,
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on June 01, 2005, 05:27:49 pm

No problem... the newer version went out last night

Hi vuud,

thank you once again for your kind help and supporting actions  :P

Best regards from Berlin - Germany, Phil,
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: elyk on June 22, 2005, 09:21:21 am
The validator link tells me "XML parsing error: <unknown>:1:0: no element found".
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on June 22, 2005, 09:44:18 am
The validator link tells me "XML parsing error: <unknown>:1:0: no element found".

Fantastic...

Whats the link to your feed?  What happens if you point a web browser at it?

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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

Code: [Select]
<?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:

Code: [Select]

<?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
Code: [Select]
<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/



Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on July 18, 2005, 06:59:16 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

Code: [Select]
<?php

$ENABLED 
=false;

?>




Change that to $ENABLED=true;
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Philcomputing on July 18, 2005, 09:27:50 pm
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



Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on July 20, 2005, 10:25:20 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
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: HanOverFist on July 20, 2005, 10:28:08 pm
no prob.
nice work on your end.
very cool feature.

Jay
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on July 20, 2005, 11:47:58 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.

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: freesouljah on July 27, 2005, 08:25:56 pm
Hello again :)

I am getting this error:

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

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:

Code: [Select]
<?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:


Code: [Select]
<?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 /////////



Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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



Hello again :)

I am getting this error:

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

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:

Code: [Select]
<?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:


Code: [Select]
<?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 /////////




Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: freesouljah on July 28, 2005, 05:47:16 am


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)
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on August 28, 2005, 09:24:25 pm
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 :(
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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>
..................
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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?




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>
..................
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: fferro on September 05, 2005, 05:30:44 pm

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.
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: 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 ;)
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on October 21, 2005, 06:19:24 am
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...
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: 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)

Code: [Select]
<?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

Code: [Select]
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
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: vuud on November 26, 2005, 08:08:44 pm

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.


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)

Code: [Select]
<?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

Code: [Select]
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

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: Colegota on November 26, 2005, 08:34:26 pm
Hi!

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
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: vuud on November 26, 2005, 09:42:39 pm
Hi!

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?

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: Colegota on November 26, 2005, 10:05:06 pm
Hi!

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?

I'm not sure, but I think the first option is better because there is a cron procces that runs feed every 30 minutes. So I want to take the albums created or updated on last 30 minutes.
The problem can be if an album is updated twice in a couple hours, but I think with the first method the entry will not be updated (nor duplicated) on the page.

In other words, I'd like every time one member added photos to an album, I have an article on our main page.
If you take a look to http://mapamundi.info at this moment, you can see five entries for 5 photos in 2 different albums ("Corcega" and "Estambul y Mar Negro"). I just want 2 entries. One for each album.

I'd like an article with a title such as "New photos added to album %a by %o" (assuming %a is the name of the album, and %o is the owner). And if posibble, can change the size of the image.

Regards,
Colegota
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: vuud on November 26, 2005, 10:23:36 pm

Either way, duplicates would be ignored.  The last # of them would be the easiest to code though.

So to actually clarify:

You want an RSS feed that shows the last image added to the last # of albums.  So no matter how many are added to an album recently, only the latest one is shown?

In your case # is "2"



Hi!

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?

I'm not sure, but I think the first option is better because there is a cron procces that runs feed every 30 minutes. So I want to take the albums created or updated on last 30 minutes.
The problem can be if an album is updated twice in a couple hours, but I think with the first method the entry will not be updated (nor duplicated) on the page.

In other words, I'd like every time one member added photos to an album, I have an article on our main page.
If you take a look to http://mapamundi.info at this moment, you can see five entries for 5 photos in 2 different albums ("Corcega" and "Estambul y Mar Negro"). I just want 2 entries. One for each album.

I'd like an article with a title such as "New photos added to album %a by %o" (assuming %a is the name of the album, and %o is the owner). And if posibble, can change the size of the image.

Regards,
Colegota

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: Colegota on November 26, 2005, 10:50:00 pm
Either way, duplicates would be ignored.  The last # of them would be the easiest to code though.

Ok.

So to actually clarify:
You want an RSS feed that shows the last image added to the last # of albums.

Yes.

So no matter how many are added to an album recently, only the latest one is shown?

For me is enought with the last one. But it can be nice to have the four or even eight (can be customizable) last added photos as thumbnails in the article.

Depending on your time and your interest you can code several ways:

- Just one photo with a medium customizable size (like 'imagewidth' => '500'). A title with the name of the album and the owner. And a text telling the album has # of new images.

- Same as before but including a row with thumbs of (customizable)  of last images (4 is ok) under the main (last) photo. Of course, if there is more than one photo added to album.

- Just the thumbs of the last # of images added.

I also own a website about free photography with CPG/SMF where I'm planning install Wordpress in a similar way to mapamundi and sindycate your feeds. So there I use to put images bigger and some changes. So as much flexible, as better.

Your effort is very appreciated. Please code that you find better. I'm very grateful.

Best regards,
Colegota

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: vuud on November 26, 2005, 11:04:29 pm

I'll code up an RSS to give the last added image from the last updated albums.

Either way, duplicates would be ignored.  The last # of them would be the easiest to code though.

Ok.

So to actually clarify:
You want an RSS feed that shows the last image added to the last # of albums.

Yes.

So no matter how many are added to an album recently, only the latest one is shown?

For me is enought with the last one. But it can be nice to have the four or even eight (can be customizable) last added photos as thumbnails in the article.

Depending on your time and your interest you can code several ways:

- Just one photo with a medium customizable size (like 'imagewidth' => '500'). A title with the name of the album and the owner. And a text telling the album has # of new images.




- Same as before but including a row with thumbs of (customizable)  of last images (4 is ok) under the main (last) photo. Of course, if there is more than one photo added to album.

- Just the thumbs of the last # of images added.

I also own a website about free photography with CPG/SMF where I'm planning install Wordpress in a similar way to mapamundi and sindycate your feeds. So there I use to put images bigger and some changes. So as much flexible, as better.

Your effort is very appreciated. Please code that you find better. I'm very grateful.

Best regards,
Colegota


Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: Colegota on November 27, 2005, 04:53:48 pm
I'll code up an RSS to give the last added image from the last updated albums.

Nice! :)
Please let me know when you finish and if I can help you anyway.

Best regards,
Colegota
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH (for last albums)
Post by: vuud on November 27, 2005, 09:23:05 pm
I'll code up an RSS to give the last added image from the last updated albums.

Nice! :)
Please let me know when you finish and if I can help you anyway.

Best regards,
Colegota


Patience, and if you don't hear from me in two days, PM me...  I am forgetfull at times

 :D

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: koch on December 06, 2005, 12:49:03 pm
Can U help me?

In feed.xml in IMG URL I got double slash and thums do not shows :(

img src="http://mkruiz.ru/vitadibordo//albums/userpics/10033/thumb_im13.jpg"

all other works and links fine
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on December 06, 2005, 07:03:36 pm
Can U help me?

In feed.xml in IMG URL I got double slash and thums do not shows :(

img src="http://mkruiz.ru/vitadibordo//albums/userpics/10033/thumb_im13.jpg"

all other works and links fine

I can't pull up that image in a web browser if I stick the url in... even without the double slash in there.  I get a server error

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: koch on December 07, 2005, 09:37:41 am
Quote
I can't pull up that image in a web browser if I stick the url in... even without the double slash in there.  I get a server error

it was just an example

here is the real links inj RSS feed

http://mkruiz.ru/vitadibordo/cpmfetch/cfrssget.php

Thank You
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: freesouljah on December 19, 2005, 01:48:13 pm
hello again  ;)

I just noticed this, but with the new bridge file for phpBB 2.18 the rss feed isn't working right...

It shows the photo & info like normal, but when someone clicks the thumbnail or the 'open in browser' option it gives this error:

Quote
Notice: Use of undefined constant PHPBB_SESSIONS_KEYS_TABLE - assumed 'PHPBB_SESSIONS_KEYS_TABLE' in /home/staticp/public_html/photos/bridge/phpbb.inc.php on line 108
Fatal error :
There was an error while processing a database query


line 108 is:

Code: [Select]
$sql = "SELECT u.user_id, u.username as user_name, u.user_level, u.user_posts " . "FROM " .  $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_SESSIONS_KEYS_TABLE . " AS s INNER JOIN " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " AS u ON s.user_id = u.user_id WHERE u.user_id = '$cookie_uid' AND u.user_active = 1 AND s.key_id = MD5('$cookie_pass')";


and the old one (before the 2.18 update) was:

Code: [Select]
$sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " " . "WHERE user_id='$cookie_uid' AND user_password='$cookie_pass' AND user_active='1'";
thanks
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: freesouljah on January 03, 2006, 04:24:00 am
should I ask this question elsewhere?
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on January 03, 2006, 04:54:49 am
hello again  ;)

I just noticed this, but with the new bridge file for phpBB 2.18 the rss feed isn't working right...

It shows the photo & info like normal, but when someone clicks the thumbnail or the 'open in browser' option it gives this error:


line 108 is:

Code: [Select]
$sql = "SELECT u.user_id, u.username as user_name, u.user_level, u.user_posts " . "FROM " .  $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_SESSIONS_KEYS_TABLE . " AS s INNER JOIN " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " AS u ON s.user_id = u.user_id WHERE u.user_id = '$cookie_uid' AND u.user_active = 1 AND s.key_id = MD5('$cookie_pass')";


and the old one (before the 2.18 update) was:

Code: [Select]
$sql = "SELECT user_id, username as user_name, user_level " . "FROM " . $UDB_DB_NAME_PREFIX . PHPBB_TABLE_PREFIX . PHPBB_USER_TABLE . " " . "WHERE user_id='$cookie_uid' AND user_password='$cookie_pass' AND user_active='1'";
thanks

I don't think this is an cpmfetch question... not sure where bridge questions would be asked though

Sorry

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: freesouljah on January 17, 2006, 04:56:22 am
okay...thanks anyways...
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: noworyz on February 07, 2006, 11:04:45 pm
Can U help me?

In feed.xml in IMG URL I got double slash and thums do not shows :(

img src="http://mkruiz.ru/vitadibordo//albums/userpics/10033/thumb_im13.jpg"

all other works and links fine

I am having the same problem.

my rss feed= http://egriz.com/phpfiles/cpmfetch2/rss_lastadded.php (http://egriz.com/phpfiles/cpmfetch2/rss_lastadded.php)
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: Gephri on February 17, 2006, 05:36:49 pm
For me: it's so difficult to make it so easy!

I can get the RSS feed to work - it's a beautiful thing - but would like to have a feed that shows only my channel title, and description and then 5 images centered down a column.  Simply put - is there a way to not show all the text/file info within the feed?

Thanks
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: niks_007 on April 01, 2006, 10:37:24 pm
hi.....
          My CPM Fatch is working but Rss Feed is Not

The Following Error occrs plz help


Warning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/nishant/public_html/getimage/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/nishant/public_html/getimage/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.

I have tried giving 777 permission but doesn't helped

help me...
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on April 05, 2006, 04:22:01 am
hi.....
          My CPM Fatch is working but Rss Feed is Not

The Following Error occrs plz help


Warning: fopen(./tmp/feed.xml): failed to open stream: No such file or directory in /home/nishant/public_html/getimage/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/nishant/public_html/getimage/libs/feedcreator.class.php on line 686

Error creating feed file, please check write permissions.

I have tried giving 777 permission but doesn't helped

help me...

Where did you create the tmp directory?

Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: schalicto on July 29, 2006, 05:28:24 am
Looking for help getting cpmfetch installed.  I am running coppermine 1.4 and I have it installed at a root subdomain at http://pictures.floor42online.com (http://pictures.floor42online.com)
When i run the test at
http://pictures.floor42online.com/cpmfetch/cftest.php (http://pictures.floor42online.com/cpmfetch/cftest.php)
It tells me that I have to resolve my problem on line five of cftest.php
But I have already changed that to read $ChangeThisToYourPartialUrlToCPG = "/"; which should be what points to the root.

My main goal is to get an rss feed running on my coppermine gallery but I don't know much about anything.  So after I get this problem resoved then I'll probably have another one.  Thanks in advance!

-Josh
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on July 29, 2006, 04:03:52 pm
Looking for help getting cpmfetch installed.  I am running coppermine 1.4 and I have it installed at a root subdomain at http://pictures.floor42online.com (http://pictures.floor42online.com)
When i run the test at
http://pictures.floor42online.com/cpmfetch/cftest.php (http://pictures.floor42online.com/cpmfetch/cftest.php)
It tells me that I have to resolve my problem on line five of cftest.php
But I have already changed that to read $ChangeThisToYourPartialUrlToCPG = "/"; which should be what points to the root.

My main goal is to get an rss feed running on my coppermine gallery but I don't know much about anything.  So after I get this problem resoved then I'll probably have another one.  Thanks in advance!

-Josh

Hi Josh,

Can you post a copy of the first ten lines of that file?   I have my doubts that it has been changed, or at the least not uploaded to the server.


This is the code fragment for #5
Code: [Select]
$testnumber = 5;
if ($ChangeThisToYourPartialUrlToCPG == "/changethishere") {
OutputTestRow($testnumber,"You forgot to edit line 5 of cftest.php","FAIL");
$GOODTOTRY = false;
$TESTS_PREVENTING .= "$testnumber ";
}


The ONLY [that I can think of] way to get that error is to still have "/changethishere" as your directory.  Did you not upload your changed version to the server or something?



Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: schalicto on July 30, 2006, 07:40:08 pm
Code: [Select]
<?php
// You need to change this variable to the directory that the Coppermine photo gallery is installed in.
// If you installed CPG to the root of your website, just use a /
// IMPORTANT:  Change the part below in quotes, NOT the $ChangeThis... part
$ChangeThisToYourPartialUrlToCPG "/";

// DO NOT CHANGE ANYTHING BELOW THIS LINE... THE ONLY THING YOU NEED
// TO CHANGE IS ABOVE HERE.

// GO NO FURTHER... UNLESS SPECIFICALLY TOLD TO

// REALLY

This is direct from the version on the server.

-Josh
Title: Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
Post by: vuud on July 30, 2006, 07:45:20 pm
Code: [Select]
<?php
// You need to change this variable to the directory that the Coppermine photo gallery is installed in.
// If you installed CPG to the root of your website, just use a /
// IMPORTANT:  Change the part below in quotes, NOT the $ChangeThis... part
$ChangeThisToYourPartialUrlToCPG "/";

// DO NOT CHANGE ANYTHING BELOW THIS LINE... THE ONLY THING YOU NEED
// TO CHANGE IS ABOVE HERE.

// GO NO FURTHER... UNLESS SPECIFICALLY TOLD TO

// REALLY

This is direct from the version on the server.

-Josh


That is friggin wierd.  You can see why I would think that right?  Anyway - skip over the cftest thing and just start playing with it.  You may have issues with the root thing, thats always been an issue and for the life of me I can't remember if I ever fixed it properly.  I have a development version here that has been in parts on my workbench for months.  It's been busy.

I need to wrap it up, as it resolves a bunch of very annoying issues.

So move forward young man.  Ignore cftest.php