Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: MediaRSS feed (for PicLens, and others ?)  (Read 21060 times)

0 Members and 1 Guest are viewing this topic.

AndrewRH

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
    • The Reeves-Hall Family
MediaRSS feed (for PicLens, and others ?)
« on: December 05, 2007, 11:27:02 am »

Hi,

I am wondering if Coppermine supports (or will support) something called "MediaRSS".  Or, perhaps there is a plug-in that does?

I didn't find any reference to MediaRSS when searching these boards; but I did find a reference to RSS that may be similar (RSS feed of pics for Google Screensaver ).

Before I go ahead with the plug-in mentioned there, I wanted to be sure its what is needed...so anyone's help would be appreciated.

A brief background...
There is a plugin for Firefox called "PicsLens" which will let you see the images full-screen by hovering over their thumbnail.

A sample photo site with MediaRSS that works with PicLens is here: http://www.emilysphotosite.com/

The Wikipedia says MediaRSS was started by Yahoo and describes it as:
Quote
Media RSS allows for a much more detailed description of the content to be delivered to the subscriber than is covered by the RSS standard.


Thanks for a great photo system (my site has four years worth of photos and videos of my kids!  Great for the grandparents!),

Logged
~Andrew~

colinsp

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #1 on: February 18, 2008, 10:10:49 am »

Andrew

If you install the RSS / Atom feed mod your gallery will work with PicLens. I removed EasyRSS and installed this and it works fine.

Colin
Logged

shiftsrl

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
    • Apple Reseller
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #2 on: April 14, 2008, 05:25:25 pm »

Wow, it works!!! The only problems is that only works for the images that I see in the bottom of the gallery, in my case the latest uploaded, but not if I enter in an album. How can I make it works also inside an album?
Logged
Shift Srl
 *Link Removed*

shiftsrl

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
    • Apple Reseller
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #3 on: April 14, 2008, 05:26:41 pm »

Sorry, dumb question. The plugin works only that way...
Logged
Shift Srl
 *Link Removed*

shiftsrl

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 74
    • Apple Reseller
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #4 on: April 14, 2008, 10:35:29 pm »

Well, due to the fact that this plugin works, it's not possible for a willing coder out there to take the code and make it work also with albums and categories? I ask this since I've seen in the readme file

Quote
Limitations
------------------------
This plugin can't identify albums or categories name. It's only display the latest 10 photos (tweakable) in the RSS feed.

and this is a shame since this plugin works perfectly with piclens...
Logged
Shift Srl
 *Link Removed*

mrbones

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #5 on: May 27, 2008, 07:16:15 am »

Well, you can "tweak" it a little ... just open the xfeed.php file and edit the following line:

//*** user tunable ***
$upperlimit = 10; //feed limit

I use:

//*** user tunable ***
$upperlimit = 2000; //feed limit

and it displays the last 2000 images that have been uploaded. I believe that this is more than enough. Furthermore, I have tested it with 10000 as well -- no problems. Stil, I miss the option to displays the images by categories ... but the world is not perfect after all :).
Logged

ryback

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 8
  • http://www.fotecka.net
    • Photogalery
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #6 on: June 21, 2008, 12:40:29 am »

Hi,

it works great. But there is one security hole. If there are private photos or private album in last ten (or XX) photos, they are shown as well as non secured pictures :-(
Logged
Casey
------------------------
http://www.fotecka.net
http://dino.saur.cz

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 153
    • DJ-Daz
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #7 on: December 19, 2008, 12:40:53 pm »

Thank you for the excellent RSS feeder Colin, works brilliantly with google photo's screensaver and Piclens.
Logged
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.

Deus

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 153
    • DJ-Daz
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #8 on: December 20, 2008, 06:58:35 pm »

I'm trying to get piclens working in a safe/local environment, (while I try and get my gellery and piclens working on the playstation 3), and so far I've got place holders for the thumbnails, but no images.
I'm wondering if the mediaRSS feed is dependant on any specific modules?
Logged
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.

PeterLawrence

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 22
    • Civil Service Canoe Club
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #9 on: January 16, 2009, 06:41:34 pm »

Here is an updated version of the xfeed.php file which will output results for a given album if specified.
Code: [Select]
<?php
//
//  Coppermine xfeeds plugin
// displays latest photo via RSS 2.0 or Atom 1.0 feed.
//  Compatible with : Coppermine 1.3.x
//
//  Hacked at : 17 November 2005, 21:15 +0800
// Hacked at : 06 November 2005, 21:12 +0800
// Originally Hacked at : 22 October 2005, 0400 +0800
//  Modified by P.J.Lawrence December 2008 to output a feed per an album
//  To display a feed for a given album type xfeed.php?album=ID 
//  where ID is the album which the feed is required for.
//
// Copyright (C) 2005 Mohammad Hafiz bin Ismail (mypapit)
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
// Report problems and direct all questions to:
//
// <mypapit@gmail.com>
//
// For latest version of this software, please visit :
//
// http://mypapit.net/pproject
// http://blog.mypapit.net/
//
// authors email : mypapit@gmail.com, papit01@lycos.com
//

// This partly taken

//*** user tunable ***
$upperlimit 10//feed limit

// WARNING : No user servicable parts below here
define('INC_COMMENT_TIMES'false);
define('FILEDUMP'false);
define('GZ_COMPRESS'false);
// [0.0 <= priority <= 1.0]
define('P_DISPLAYIMAGE'0.5);
define('P_ALBUM'0.5);
define('P_CATEGORY'0.5);

// [changefreq = always || hourly || daily || weekly || monthly || yearly || never]
define('CF_DISPLAYIMAGE''unspecified');
define('CF_ALBUM''unspecified');
define('CF_CATEGORY''unspecified');
define('IN_COPPERMINE'true);

require(
'include/init.inc.php');

// This should work as it is, but hardcode if necessary.
define('CPG14'version_compare(COPPERMINE_VERSION"1.4.0"">="));
define('PHP5'version_compare(phpversion(), "5"">="));
$base rtrim($CONFIG['ecards_more_pic_target'], '/');
$albumpath "$base/" $CONFIG['fullpath'];
$gallery_name=$CONFIG['gallery_name'];
$author_email=$CONFIG['gallery_admin_email'];

function 
getmime ($Filename) {
    
$mimetype="text/plain";
    
// make an array, each value seperated by a period (.)
    
$Extension explode ("."$Filename);

    
// Count how many are in array, and -1 due to
    // php starting an array with 0
    
$Extension_i = (count($Extension) - 1);

    
// Return it..
    
    
$ext $Extension[$Extension_i];
    
    if (
$ext == "jpg") {
       
$mimetype="image/jpeg";
         
    } else if (
$ext == "png") {
       
$mimetype="image/png";
    } else if ( 
$ext == "gif") {
      
$mimetype="image/gif";
    }
    return 
$mimetype;


function 
lmdate($timestamp)
{
if (PHP5){
return date('c'$timestamp);
} else {
return date('D, d M Y H:i:s +0800'$timestamp date('Z'));
}
}

function 
rfc3339date ($timestamp)
{

//2002-10-02T15:00:00Z
return(date("Y-m-d"$timestamp date('Z')) . "T" date("H:i:s"$timestamp date('Z') ) . "Z");
}

//cpg_db_connect(); // uncomment this line if you're having problem connecting to the database

$TheAlbum=null;
if (isset(
$_GET['album']))
{
$TheAlbum = (int) $_GET['album'];
$resultAlbum mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid=$TheAlbum");
    list(
$aaid$atitle$adescription) = mysql_fetch_row($resultAlbum);
    
$result mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, filesize, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE aid=$aaid ORDER BY ctime ASC, pid ASC");
}
else
{
    
// set atitle and adescription
    
$atitle=$gallery_name;
    
$adescription=$CONFIG['gallery_description'];
    
// find the last $upperlimit uploaded images
    
$result mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, filesize, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} ORDER BY ctime DESC, pid DESC LIMIT 
0,
$upperlimit");
}
if (isset(
$_GET['type']))
{
    
$feedtype $_GET['type'];
}
header("Content-type: text/xml; charset=utf-8");
if (
$feedtype == "atom")
{
    
atom10();
}
else
{
    
rss20();
}

function 
rss20() {
global $result,$base,$gallery_name,$author_email,$albumpath;
    global 
$atitle,$adescription,$TheAlbum;

print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
\n";
print "<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"";
print " xmlns:photo=\"http://www.pheed.com/pheed/\" xmlns:media=\"http://search.yahoo.com/mrss\" >";
print "<channel>\n";
print "<title>$atitle</title>\n";
    if (isset($TheAlbum))
    {
        print "<link>$base/thumbnails.php?album=$TheAlbum</link>\n";
    }
    else
    {
        print "<link>$base</link>\n";
    }
print "<description>$adescription</description>";
print "<lastBuildDate>"  . lmdate(time()) . "</lastBuildDate>\n";
print "<generator>Mypapit CPG RSS-Plugin 2.1 http://mypapit.net/</generator>\n";

    while (list($pid, $aid,$caption, $ctime, $title, $keywords,$filepath,$filename,  $owner, $fsize,$width, $height) = mysql_fetch_row($result)) {
print "\t<item>\n";
print "\t\t<title> $title </title>\n";
print "\t\t<link>$base/displayimage.php?pos=-$pid</link>\n";
print "\t\t<guid>$base/displayimage.php?pos=-$pid</guid>\n";
print "\t\t<author>$author_email</author>\n";
print "\t\t<pubDate>" . lmdate($ctime) . "</pubDate>\n";
print "\t\t<description>\n";
echo  "\t\t\t\t$caption - $keywords\n";
print "\t\t</description>\n";
print "\t\t<comments>$base/displayimage.php?pos=-$pid#respond</comments>\n";
print "\t\t<content:encoded>";
print "<![CDATA[" . "<p><img src=\"$albumpath$filepath" . "thumb_$filename\" alt=\"\" /> </p><p>$caption&nbsp;</p><p>$keywords</p>" . "]]>\n";
print "\t\t</content:encoded>\n";
print "\t\t<media:title> $title </media:title>\n";
print "\t\t<media:description type=\"plain\">\n";
echo  "\t\t\t\t$caption - $keywords\n";
print "\t\t</media:description>\n";
print "\t\t<media:keywords>$keywords</media:keywords>\n";
print "\t\t<media:content  url=\"$albumpath$filepath$filename\" width=\"$width\" height=\"$height\" type=\"". getmime($filename) ."\" />\n";
print "\t\t<media:thumbnail url=\"$albumpath$filepath" . "thumb_$filename\" />\n";
print "\t\t<photo:imgsrc>$albumpath$filepath$filename</photo:imgsrc>\n";
print "\t\t<photo:thumbnail>$albumpath$filepath" . "thumb_$filename</photo:thumbnail>\n";
print "\t\t<enclosure length=\"$fsize\" url=\"$albumpath$filepath" . "$filename\" type=\"". getmime($filename) ."\" />\n";
print "\t</item>\n";
}
print "</channel>";
print "</rss>";
}

function atom10() {
global $result,$base,$gallery_name,$author_email,$albumpath;
    global $atitle;

print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n";
print "<title>$atitle</title>\n";
print "<link href=\"$base\" />\n";
    if (isset($TheAlbum))
    {
        print "<link href=\"$base/thumbnails.php?album=$TheAlbum\" />\n";
    }
    else
    {
        print "<link href=\"$base\" />\n";
    }
print "<updated>"  . rfc3339date(time()) . "</updated>\n";
print "<author><name>Mypapit CPG RSS-Plugin http://mypapit.net/</name></author>\n";
print "<id>$base/</id>\n";
print "<generator uri=\"http://mypapit.net/\" version=\"1.0\">Coppermine 1.3.x xfeed mod</generator>\n";
print "<link rel=\"self\" type=\"application/atom+xml\" href=\"$base" . $_SERVER["PHP_SELF"] . "?type=atom\" />";

while (list($pid, $aid,$caption, $ctime, $title, $keywords,$filepath,$filename,  $owner, $fsize,$width, $height) = mysql_fetch_row($result)) {
print "\t<entry>\n";
print "\t\t<title> $title </title>\n";
print "\t\t<link href=\"$base/displayimage.php?pos=-$pid\" />\n";
print "\t\t<id>$base/displayimage.php?pos=-$pid</id>\n";
print "\t\t<updated>" . rfc3339date($ctime) . "</updated>\n";
print "\t\t<summary type=\"xhtml\">";
print "\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo  htmlentities("<p><img src=\"$albumpath$filepath" . "thumb_$filename\" alt=\"\" /> </p><p>$caption&nbsp;</p><p>$keywords</p>");
print "\t\t</div></summary>\n";
print "\t</entry>\n";
}
print "</feed>";
}
?>
Now for example entering  xfeed.php?album=10 will display a Media RSS feed for just album 10.
However, if you don't specify an album it works as before.
Note this php still has the same security hole as the original xfeed.php regarding private albums/photos.
« Last Edit: January 17, 2009, 01:12:36 am by PeterLawrence »
Logged

PeterLawrence

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 22
    • Civil Service Canoe Club
Re: MediaRSS feed (for PicLens, and others ?)
« Reply #10 on: January 17, 2009, 12:55:03 am »

Here is a revised version which should only display images for which the user is allowed to view.
I've added a call to get_private_album_set() and then check to see if the required album is not in the FORBIDDEN_SET_DATA list.
Code: [Select]
<?php
//
//  Coppermine xfeeds plugin
// displays latest photo via RSS 2.0 or Atom 1.0 feed.
//  Compatible with : Coppermine 1.3.x
//
//  Hacked at : 17 November 2005, 21:15 +0800
// Hacked at : 06 November 2005, 21:12 +0800
// Originally Hacked at : 22 October 2005, 0400 +0800
//  Modified by P.J.Lawrence Jan 2009 to output a feed per an album
//  To display a feed for a given album type xfeed.php?album=ID 
//  where ID is the album which the feed is required for.
//
// Copyright (C) 2005 Mohammad Hafiz bin Ismail (mypapit)
//
// 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.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//
// Report problems and direct all questions to:
//
// <mypapit@gmail.com>
//
// For latest version of this software, please visit :
//
// http://mypapit.net/pproject
// http://blog.mypapit.net/
//
// authors email : mypapit@gmail.com, papit01@lycos.com
//

// This partly taken

//*** user tunable ***
$upperlimit 10//feed limit

// WARNING : No user servicable parts below here
define('INC_COMMENT_TIMES'false);
define('FILEDUMP'false);
define('GZ_COMPRESS'false);
// [0.0 <= priority <= 1.0]
define('P_DISPLAYIMAGE'0.5);
define('P_ALBUM'0.5);
define('P_CATEGORY'0.5);

// [changefreq = always || hourly || daily || weekly || monthly || yearly || never]
define('CF_DISPLAYIMAGE''unspecified');
define('CF_ALBUM''unspecified');
define('CF_CATEGORY''unspecified');
define('IN_COPPERMINE'true);

require(
'include/init.inc.php');

// This should work as it is, but hardcode if necessary.
define('CPG14'version_compare(COPPERMINE_VERSION"1.4.0"">="));
define('PHP5'version_compare(phpversion(), "5"">="));
$base rtrim($CONFIG['ecards_more_pic_target'], '/');
$albumpath "$base/" $CONFIG['fullpath'];
$gallery_name=$CONFIG['gallery_name'];
$author_email=$CONFIG['gallery_admin_email'];

function 
getmime ($Filename) {
    
$mimetype="text/plain";
    
// make an array, each value seperated by a period (.)
    
$Extension explode ("."$Filename);

    
// Count how many are in array, and -1 due to
    // php starting an array with 0
    
$Extension_i = (count($Extension) - 1);

    
// Return it..
    
    
$ext $Extension[$Extension_i];
    
    if (
$ext == "jpg") {
       
$mimetype="image/jpeg";
         
    } else if (
$ext == "png") {
       
$mimetype="image/png";
    } else if ( 
$ext == "gif") {
      
$mimetype="image/gif";
    }
    return 
$mimetype;


function 
lmdate($timestamp)
{
if (PHP5){
return date('c'$timestamp);
} else {
return date('D, d M Y H:i:s +0800'$timestamp date('Z'));
}
}

function 
rfc3339date ($timestamp)
{

//2002-10-02T15:00:00Z
return(date("Y-m-d"$timestamp date('Z')) . "T" date("H:i:s"$timestamp date('Z') ) . "Z");
}

//cpg_db_connect(); // uncomment this line if you're having problem connecting to the database
get_private_album_set();
$TheAlbum=null;
if (isset(
$_GET['album']))
{
$TheAlbum = (int) $_GET['album'];
$resultAlbum mysql_query("SELECT aid, title, description FROM {$CONFIG['TABLE_ALBUMS']} WHERE aid=$TheAlbum");
$result=false;
if ($resultAlbum)
{
list($aaid$atitle$adescription) = mysql_fetch_row($resultAlbum);
if (!in_array($aaid,$FORBIDDEN_SET_DATA))
{
    $result mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, filesize, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE aid=$aaid ORDER BY ctime ASC, pid ASC");
}
}
}
else
{
    
// set atitle and adescription
    
$atitle=$gallery_name;
    
$adescription=$CONFIG['gallery_description'];
    
// find the last $upperlimit uploaded images
if(count($FORBIDDEN_SET_DATA) > )
{
$forbidden_set_string =" aid NOT IN (".implode(","$FORBIDDEN_SET_DATA).")";
$result mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, filesize, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} WHERE ($forbidden_set_string) ORDER BY ctime DESC, pid DESC LIMIT 0,$upperlimit");
}
else
{
$result mysql_query("SELECT pid, aid, caption, ctime, title, keywords, filepath, filename, owner_name, filesize, pwidth, pheight FROM {$CONFIG['TABLE_PICTURES']} ORDER BY ctime DESC, pid DESC LIMIT 0,$upperlimit");
}
}
if (isset(
$_GET['type']))
{
    
$feedtype $_GET['type'];
}

if (
$result)
{
header("Content-type: text/xml; charset=utf-8");
if ($feedtype == "atom")
{
    atom10();
}
else
{
    rss20();
}
}

function 
rss20() {
global $result,$base,$gallery_name,$author_email,$albumpath;
    global 
$atitle,$adescription,$TheAlbum;
global $FORBIDDEN_SET_DATA;

print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
\n";
print "<rss version=\"2.0\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"";
print " xmlns:photo=\"http://www.pheed.com/pheed/\" xmlns:media=\"http://search.yahoo.com/mrss\" >";
print "<channel>\n";
print "<title>$atitle</title>\n";
    if (isset($TheAlbum))
    {
        print "<link>$base/thumbnails.php?album=$TheAlbum</link>\n";
    }
    else
    {
        print "<link>$base</link>\n";
    }
print "<description>".htmlspecialchars(bb_decode($adescription))."</description>";
print "<lastBuildDate>"  . lmdate(time()) . "</lastBuildDate>\n";
print "<generator>Mypapit CPG RSS-Plugin 2.1 http://mypapit.net/</generator>\n";

    while (list($pid, $aid,$caption, $ctime, $title, $keywords,$filepath,$filename,  $owner, $fsize,$width, $height) = mysql_fetch_row($result)) {
print "\t<item>\n";
bb_decode($caption_text);   
print "\t\t<title>".htmlspecialchars(bb_decode($title))."</title>\n";
print "\t\t<link>$base/displayimage.php?pos=-$pid</link>\n";
print "\t\t<guid>$base/displayimage.php?pos=-$pid</guid>\n";
print "\t\t<author>$author_email</author>\n";
print "\t\t<pubDate>" . lmdate($ctime) . "</pubDate>\n";
print "\t\t<description>\n";
echo  "\t\t\t\t$caption - $keywords\n";
print "\t\t</description>\n";
print "\t\t<comments>$base/displayimage.php?pos=-$pid#respond</comments>\n";
print "\t\t<content:encoded>";
print "<![CDATA[" . "<p><img src=\"$albumpath$filepath" . "thumb_$filename\" alt=\"\" /> </p><p>$caption&nbsp;</p><p>$keywords</p>" . "]]>\n";
print "\t\t</content:encoded>\n";
print "\t\t<media:title> $title </media:title>\n";
print "\t\t<media:description type=\"plain\">\n";
echo  "\t\t\t\t$caption - $keywords\n";
print "\t\t</media:description>\n";
print "\t\t<media:keywords>$keywords</media:keywords>\n";
print "\t\t<media:content  url=\"$albumpath$filepath$filename\" width=\"$width\" height=\"$height\" type=\"". getmime($filename) ."\" />\n";
print "\t\t<media:thumbnail url=\"$albumpath$filepath" . "thumb_$filename\" />\n";
print "\t\t<photo:imgsrc>$albumpath$filepath$filename</photo:imgsrc>\n";
print "\t\t<photo:thumbnail>$albumpath$filepath" . "thumb_$filename</photo:thumbnail>\n";
print "\t\t<enclosure length=\"$fsize\" url=\"$albumpath$filepath" . "$filename\" type=\"". getmime($filename) ."\" />\n";
print "\t</item>\n";
}
print "</channel>";
print "</rss>";
}

function atom10() {
global $result,$base,$gallery_name,$author_email,$albumpath;
    global $atitle;
global $FORBIDDEN_SET_DATA;

print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
print "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n";
print "<title>$atitle</title>\n";
print "<link href=\"$base\" />\n";
    if (isset($TheAlbum))
    {
        print "<link href=\"$base/thumbnails.php?album=$TheAlbum\" />\n";
    }
    else
    {
        print "<link href=\"$base\" />\n";
    }
print "<updated>"  . rfc3339date(time()) . "</updated>\n";
print "<author><name>Mypapit CPG RSS-Plugin http://mypapit.net/</name></author>\n";
print "<id>$base/</id>\n";
print "<generator uri=\"http://mypapit.net/\" version=\"1.0\">Coppermine 1.3.x xfeed mod</generator>\n";
print "<link rel=\"self\" type=\"application/atom+xml\" href=\"$base" . $_SERVER["PHP_SELF"] . "?type=atom\" />";

while (list($pid, $aid,$caption, $ctime, $title, $keywords,$filepath,$filename,  $owner, $fsize,$width, $height) = mysql_fetch_row($result)) {
print "\t<entry>\n";
print "\t\t<title>$title</title>\n";
print "\t\t<link href=\"$base/displayimage.php?pos=-$pid\" />\n";
print "\t\t<id>$base/displayimage.php?pos=-$pid</id>\n";
print "\t\t<updated>" . rfc3339date($ctime) . "</updated>\n";
print "\t\t<summary type=\"xhtml\">";
print "\t\t<div xmlns=\"http://www.w3.org/1999/xhtml\">\n";
echo  htmlentities("<p><img src=\"$albumpath$filepath" . "thumb_$filename\" alt=\"\" /> </p><p>$caption&nbsp;</p><p>$keywords</p>");
print "\t\t</div></summary>\n";
print "\t</entry>\n";
}
print "</feed>";
}
?>
« Last Edit: January 17, 2009, 01:13:24 am by PeterLawrence »
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.