Media RSS plugin with Cooliris support Media RSS plugin with Cooliris support
 

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]

Main Menu

Media RSS plugin with Cooliris support

Started by paterczm, September 15, 2010, 08:54:36 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

paterczm

I wanted to have a full screen slideshow option in my gallery and decided to leverage Cooliris, a very nice media browser, which can be installed as a web browser extension. This simple coppermine 1.5.x plugin adds media rss feeds to the gallery, allowing browsing with Cooliris and possibly other use cases as well.

What it does:

  • creates media rss feed and adds a media rss link to album thumbnails page
  • adds a cooliris link next to sorting options on album thumbnails page

Issues/Limitations

  • meta albums not supported
  • ignores permissions (intended for public galleries)
  • cooliris icon does not appear on thumbnails, because a link to media rss is added to head after the page is loaded. I don't know how to do that properly without modifying coppermine core code. A cooliris link is added instead.

Requirements

  • Coppermine 1.5.x (tested with 1.5.8 )
  • DomDocument library for PHP

Demo
http://www.marek-paterczyk.waw.pl/gallery/thumbnails.php?album=36 (click the cooliris link, follow steps on screen to install Cooliris, then click the cooliris link again)

Hope you'll like it :)

nickelas

I like it!
Would be great if meta-albums would be supported sometime in the future
Thank you for the plugin
Human

paterczm

Thanks! I'll add meta albums support if I ever figure out how ;)

nickelas

Great!
One question, any way of changing the order of the images? Mine seems to be ordered older -> newer and I would like it the other way
Human

paterczm

You can change sorting order by applying the following patch:

--- a/gallery/plugins/mediarss/album_feed.php
+++ b/gallery/plugins/mediarss/album_feed.php
@@ -15,11 +15,11 @@ header('Content-type: application/rss+xml');
$aid = $superCage->get->getInt('aid');
if  ($aid > 0)
{
-       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." WHERE aid = $aid;";
+       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." WHERE aid = $aid ORDER BY ctime DESC;";
}
else
{
-       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES'].";";
+       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." ORDER BY ctime DESC;";
}

$result = cpg_db_query($query);

nickelas

Human

ppeter

hi!

i need an absolut link image.xml for using it in slideshow pro, any info how i get the media rss .xml info?

or is is the hole link

:)
peter

paterczm

Hi Peter

Open an album and click the feed icon on the right side of the url bar. E.g. http://www.marek-paterczyk.waw.pl/gallery/index.php?file=mediarss/album_feed&aid=36

Regards
Marek

ppeter




ppeter


Plappermaul

Hello,

i have changed the $query in top of the album_feed.php. Now it will display meta albums too.



paterczm

Quote from: Plappermaul on October 14, 2010, 12:02:40 AM
i have changed the $query in top of the album_feed.php. Now it will display meta albums too.

Interesting. I applied the patch, but I don't see how I can generate a feed for meta albums. Could you provide some instructions?

Thanks
Marek

uk_martin

Quote from: paterczm on September 19, 2010, 09:39:11 PM
You can change sorting order by applying the following patch:

--- a/gallery/plugins/mediarss/album_feed.php
+++ b/gallery/plugins/mediarss/album_feed.php
@@ -15,11 +15,11 @@ header('Content-type: application/rss+xml');
$aid = $superCage->get->getInt('aid');
if  ($aid > 0)
{
-       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." WHERE aid = $aid;";
+       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." WHERE aid = $aid ORDER BY ctime DESC;";
}
else
{
-       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES'].";";
+       $query = "SELECT pid, title, caption, filepath, filename FROM ".$CONFIG['TABLE_PICTURES']." ORDER BY ctime DESC;";
}

$result = cpg_db_query($query);


For simple people like me, can you please explain WHERE you apply this patch please, as I too would like to have newest photos first.

Thanks

Martin

paterczm

Quote from: uk_martin on January 23, 2011, 11:43:48 AM
For simple people like me, can you please explain WHERE you apply this patch please, as I too would like to have newest photos first.

Thanks

Martin

Automated way to apply a patch:
1) Save the patch as a text file named patch.txt in your gallery root.
2) Change directory to your gallery root.
3) Execute: patch -i patch.txt -p2 -l

Manual way to apply the patch:
Edit <gallery root>/plugins/mediarss/album_feed.php. Replace lines marked with - with lines marked with +, as indicated in the patch.

uk_martin

Thanks for the quick reply.

I now get - http://www.brummiesfans.com/gallery/index.php?file=mediarss/album_feed

There are no thumbnails in that feed, so when the CoolIris block on my site - www.brummiesfans.com  picks up on this, it just displays grey rectangles, where the thumbnails should go.

Is there a way to get this to produce a feed that looks like my "old" feed - http://www.brummiesfans.com/gallery1/rss.php

I would like to deactivate my old gallery and run the feed from the new one (/gallery1 is the "old" gallery) but I need the thumbs to be fed into CoolIris first.

Thanks

Martin

paterczm

Hm, is your site_url configured correctly? It's used by the plugin to create urls.

uk_martin

Quote from: paterczm on January 23, 2011, 12:37:37 PM
Hm, is your site_url configured correctly? It's used by the plugin to create urls.

Which configurations need to be checked? The gallery functions perfectly in all other respects.

The one other plugin which may affect the URL's is the Search Engine Friendly URLs plugin, but I've uninstalled that, tried again, and the results are no different. (I've reinstalled it again since)

Thanks for your attention to this, I hope that it won't need to be a big fix to sort this out.

Martin

paterczm

Quote from: uk_martin on January 23, 2011, 12:50:47 PM
Which configurations need to be checked? The gallery functions perfectly in all other respects.

The one other plugin which may affect the URL's is the Search Engine Friendly URLs plugin, but I've uninstalled that, tried again, and the results are no different. (I've reinstalled it again since)

Thanks for your attention to this, I hope that it won't need to be a big fix to sort this out.

Martin

Looking at gallery1 links in the feed:
http://www.brummiesfans.com/gallery/albums/2010/Away%20Stoke%2005-06/stoke_v_brummies_13.jpg (200 - OK)
Looking at gallery links in the feed:
http://www.brummiesfans.com/photos/albums/2010/Away%20Stoke%2005-06/stoke_v_brummies_13.jpg (404 - Not found)

You can check site_url in the admin panel, general settings tab. I believe it should be http://www.brummiesfans.com/gallery/ in order to work.