RSS based Gallery3 integration with Wordpress

micks80

Joined: 2012-04-22
Posts: 71
Posted: Sat, 2013-03-23 20:21

We received a lot from the community and it was about time to give back, so here's our first quick and dirty module for Gallery3 :)

Use:
-Wordpress post creation using Gallery3 photos

Need:
We use wordpress as a front-end and wanted to integrate Gallery posts seamlessly within wordpress. We tried few plugins available in the market but nothing was suiting our need. So, we devised this mechanism using RSS feed/WP-o-matic which works pretty well. Images can be cached on wordpress end or hot-linked to Gallery3. Gallery3 comes with a RSS module and you can use it with WP-o-matic for 'Latest Albums' but it does not work well with a single album RSS feed. With single album feed, it tries to create a new post for each photo within the album as it handles RSS parsing in a different way. So, we wrote this small codex that basically creates a new RSS feed and makes it compatible with wp-o-matic.

Pre-requisites:
You will need wp-o-matic available here - http://wordpress.org/extend/plugins/wp-o-matic/

Implementation:
Upload the attached files (remove _.txt extension) to your server:
modules/rss/controllers/rssw.php
modules/rss/views/feed.mrss-wp.php

A new wp-o-matic compatible rss feed will be available now - <gallery3>/rssw/feed/gallery/album/#
Enter multiple such album feeds into WP-o-matic and click import and it will create all the posts with the images :)
This way you can also select multiple wordpress categories for one post. Let us know for any questions.

Cheers,
Mick

AttachmentSize
feed.mrss-wp.php_.txt2.42 KB
rssw.php_.txt2.32 KB
 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2013-03-23 20:42

Here is mine based on G3's RESTful interface
http://wp.suprsidr.com/gallery3

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
micks80

Joined: 2012-04-22
Posts: 71
Posted: Sat, 2013-03-23 21:16
Quote:
Here is mine based on G3's RESTful interface
http://wp.suprsidr.com/gallery3

-s

Actually that's the second integration we are working on, to integrate it with your wonderful script here i.e. http://www.flashyourweb.com/gallery2/embed_samples/g3_ajaxGallery.php

We want to create a 'celebs' section with 1000s of celebs profiles for each celeb in wordpress and want to display their respective photos within wordpress. E.g. Brad Pitt page should display his info, videos and all brad pitt photos from Gallery. So I am trying to use the tag rss feed i.e. rss/feed/tag/tag/# and display all brad pitt photos in wordpress using your script.

Problems to solve:
1. Not sure how to sort the RSS feed based on creation date.
2. I wish Gallery supported tags instead of tag-id for RSS as it's pretty hard to find the tag-id for each celeb.

Regards,
Mick

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sat, 2013-03-23 22:37

to sort the feed you can just cache the array into a variable and perform your favorite sort method:

var items = $(data).find('item');
items = items.mysortmethod();

then replace the iteration to:

$(items).each(function(){
...

Sorry, I don't know enough about G3 to advise on tag stuff, but I'd use the rest interface instead either way.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
micks80

Joined: 2012-04-22
Posts: 71
Posted: Sat, 2013-03-23 23:18
Quote:
Sorry, I don't know enough about G3 to advise on tag stuff, but I'd use the rest interface instead either way.

Thanks for the sort tip and no need to be sorry, you owe me nothing :)

Sure,I will follow your recommendation and try REST API instead of RSS...