Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3 4   Go Down

Author Topic: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH  (Read 63761 times)

0 Members and 1 Guest are viewing this topic.

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« 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








« Last Edit: August 28, 2005, 09:21:49 pm by vuud »
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

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

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #1 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 :)
Logged
SANIsoft PHP applications for E Biz

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #2 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


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

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

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #3 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.
Logged
SANIsoft PHP applications for E Biz

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #4 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.


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

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #5 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.



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

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #6 on: April 30, 2005, 05:52:08 pm »

I'm sure you already checked, but anyway: your feed validates! ;D
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #7 on: May 01, 2005, 06:02:15 am »

I'm sure you already checked, but anyway: your feed validates! ;D

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

Good to hear!

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

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
New Dev release up 1.3.3 - Now with RSS
« Reply #8 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.
-------------------------------------------------------------------------------------------------------








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

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #9 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
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

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

Philcomputing

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
    • Phil - Tales from the Geekside
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #10 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();
}

?>


Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #11 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
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

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

Philcomputing

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
    • Phil - Tales from the Geekside
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #12 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"
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #13 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"
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

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

Philcomputing

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
    • Phil - Tales from the Geekside
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #14 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>
« Last Edit: May 30, 2005, 12:03:59 am by Philcomputing »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #15 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)




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

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

Philcomputing

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
    • Phil - Tales from the Geekside
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #16 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,
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #17 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,
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

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

elyk

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #18 on: June 22, 2005, 09:21:21 am »

The validator link tells me "XML parsing error: <unknown>:1:0: no element found".
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - cfrssget - RSS Feeds from CPG through CPMFETCH
« Reply #19 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?

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

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1] 2 3 4   Go Up
 

Page created in 0.061 seconds with 19 queries.