forum.coppermine-gallery.net

Support => cpg1.5 plugins => cpg1.5.x Support => cpg1.5 plugin contributions => Topic started by: paterczm on September 15, 2010, 08:54:36 pm

Title: Media RSS plugin with Cooliris support
Post by: paterczm on September 15, 2010, 08:54:36 pm
I wanted to have a full screen slideshow option in my gallery and decided to leverage Cooliris (http://www.cooliris.com/), a very nice media browser, which can be installed as a web browser extension. This simple coppermine 1.5.x plugin adds media rss (http://en.wikipedia.org/wiki/Media_RSS) feeds to the gallery, allowing browsing with Cooliris and possibly other use cases as well.

What it does:

Issues/Limitations

Requirements

Demo
http://www.marek-paterczyk.waw.pl/gallery/thumbnails.php?album=36 (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 :)
Title: Re: Media RSS plugin with Cooliris support
Post by: nickelas on September 19, 2010, 08:24:57 pm
I like it!
Would be great if meta-albums would be supported sometime in the future
Thank you for the plugin
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on September 19, 2010, 08:50:42 pm
Thanks! I'll add meta albums support if I ever figure out how ;)
Title: Re: Media RSS plugin with Cooliris support
Post by: nickelas on September 19, 2010, 09:19:20 pm
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
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on September 19, 2010, 09:39:11 pm
You can change sorting order by applying the following patch:
Code: [Select]
--- 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);
Title: Re: Media RSS plugin with Cooliris support
Post by: nickelas on September 20, 2010, 09:33:31 am
Thanks
Title: Re: Media RSS plugin with Cooliris support
Post by: ppeter on September 26, 2010, 04:13:40 pm
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
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on September 27, 2010, 01:31:51 pm
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
Title: Re: Media RSS plugin with Cooliris support
Post by: ppeter on September 27, 2010, 02:24:29 pm
hi!

is this the access to the hole album on my gallery
feed://www.lfsstainz.at/gallery1/index.php?file=mediarss/album_feed
:)
peter
Title: Re: Media RSS plugin with Cooliris support
Post by: ppeter on September 27, 2010, 02:25:15 pm
feed://www.lfsstainz.at/gallery1/index.php?file=mediarss/album_feed (http://feed://www.lfsstainz.at/gallery1/index.php?file=mediarss/album_feed)
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on September 27, 2010, 04:38:43 pm
http://www.lfsstainz.at/gallery1/index.php?file=mediarss/album_feed&aid=5 - album with id 5
http://www.lfsstainz.at/gallery1/index.php?file=mediarss/album_feed&aid=0 - all albums
Title: Re: Media RSS plugin with Cooliris support
Post by: ppeter on September 27, 2010, 09:28:21 pm
thank you
Title: Re: Media RSS plugin with Cooliris support
Post by: Plappermaul on October 14, 2010, 12:02:40 am
Hello,

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


Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on October 14, 2010, 10:12:50 pm
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
Title: Re: Media RSS plugin with Cooliris support
Post by: uk_martin on January 23, 2011, 11:43:48 am
You can change sorting order by applying the following patch:
Code: [Select]
--- 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
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on January 23, 2011, 12:11:18 pm
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.
Title: Re: Media RSS plugin with Cooliris support
Post by: uk_martin on January 23, 2011, 12:32:05 pm
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
Title: Re: Media RSS plugin with Cooliris support
Post by: 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.
Title: Re: Media RSS plugin with Cooliris support
Post by: uk_martin on January 23, 2011, 12:50:47 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
Title: Re: Media RSS plugin with Cooliris support
Post by: paterczm on January 23, 2011, 01:01:40 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.
Title: Re: Media RSS plugin with Cooliris support
Post by: uk_martin on January 23, 2011, 01:08:14 pm
Yes, that's it. It all works well now. Thanks for your help.

Martin