Gallery-RSS Wordpress Plugin

Alright–with the help of magpie RSS, I cooked up my first Wordpress Plugin–as you can see to the right, it takes the RSS gallery feed and generates N number of thumbnails (you specify) of the recently updated galleries of the particular gallery (you specify) , optionally displays captions (you specify) and allows you to style the unordered list via CSS tags specific to the plugin.

Suprisingly, I could find nothing that does this for Wordpress.

It is available in its current form (caching isn’t working properly, in fact maybe not at all–I just haven’t seen any ill effects yet) below:

Upcoming Version: gallery_rss.phps
Current Release: gallery_rss_0.3.zip
CSS example (useful for "div" layout): gallery_rss.css

Installation and usage instructions are in the file.

An example of it in action is on the sidebar of my homepage.

UPDATE 2/23 – working on an update to the plugin–attempting to fix my personal problems of unexpected weirdness that seems to crop up depending on what images have been updated (i.e. the next set of text appearing immediately to the right of the four boxes on my site). You’ll be able to specify the number of columns maximum to display; i hope this will help some of you as much as it will, me. :) I’m encouraged to know that this runs just fine with Movable Type as well; gives me some motivation to cook up some other things around the plugin (i hate software bloat so my *intent* is to be as modular as possible).

  • Portraits from photos
    Hi Jon - this Gallery-RSS plugin is a great idea. Now its time to try it out. I'll let you know how it goes - thank you for sharing.
  • 0dot
    thanks
  • Zachrana Dat
    Thanks for your code,we try it now :-)
  • Web Directory
    Thank Jon,
    Interesting piece of code.
  • Eagerly awaiting the update on the download links :) Have heard wonderful things about this plug-in.
  • jon
    good looking out. i've fixed the latter; and need to restore the former. should be up tonight!

    thaks again,

    j.
  • Christian
    The download links
    http://blog.isaidjon.com/dl/gallery_rss_0.3.zip
    http://blog.isaidjon.com/dl/gallery_rss.phps
    are broken

    and the bottom of your page reads
    Possibly Related Posts

    Fatal error: Call to undefined function: related_posts() in /home/.dahlidryer/jmm/blog.isaidjon.com/wp-content/themes/smbro6/sidebar.php on line 11
  • jon
    unfortunately, i've been using flickr since :-o, and have no plans on updating the code currently; but anyone's welcome to take it on!

    j.
  • Hello Jon--

    I've been using your Gallery RSS for a few months now--thank you!

    I just upgraded my gallery to G2. As you probably know, RSS support was dropped for G2.0, though there is a module in beta available here:

    http://cvs.sourceforge.net/viewcvs.py/gallery-c...

    I have this module installed and it's generating feeds. The feed URL however is much longer and more complex than G1.5's simple blahblah/rss.php URL. I've pumped this 4 line URL into $gallery_rss_url in your plugin and uploaded the file. Unfortunately, no images are displayed. i can't tell if this is a problem with the G2 RSS module, or if it's an incompatibility with your Gallery RSS plugin.

    Any plans to support G2 with your plugin?

    cheers
    SAM :)
  • hey bro, grat plugin!, now, just wondering, hos often does it refreshes with the rss???

    thanks!!
  • Well, I very well could be wrong (I am harldy a PHP or HTML expert), but shouldn't:
    alt=\"$title\"> (line 157)

    be:

    alt=\"$title\" />

    The same with line 143.

    And, this is the version marked current release on this page.
    Again, nice job with the plugin... I am diggin' it thus far.
  • jon
    interesting. is this the new version? or the one available from the wordpress plugins site? the one you can download correctly is constanstly in flux...i say this because there are quite a few people using this plugin, and this is the first i've heard of this...as a matter of fact, i'm looking at my source and i don't see it, help a brother out! thanks.

    j.
  • nice plugin. I have only just begun to tinker with it. but, I noticed that you weren't properly closing the img tags, which caused some problems for me until I fixed it.
  • jon
    hey adam, see above for jaibharat's issue--it's a limitation of magpie. jai has a patch to my code to give you what you're looking for. i won't have support in this one until magpie is upgraded to do what jai has it doing. :)

    thanks!

    j.
  • Okay, another issue: it seems that the plugin is setting the height/width of all the thumbnails to that of the first. (View my website to see what I mean). Looking at the code, it seems that it should be setting these attributes individually, but it obviously isn't. I really want to make this plugin work, but I can't go live until I iron out these wrinkles.
    Thanks again, Jon.
  • Nevermind about my last comment. Turns out that if the cache hasn't been initialized, it'll throw that error. I loaded my gallery rss feed in an rss reader, and after that it works. My next question: How do I get the side by side setup? When I first saw this the other day, your Last Updates was showing 4 thumbnails in a 2x2 matrix (table?). How do I do this? If it's css trickery, then can you help me out with that, as I'm a total css novice? Thanks again!
  • Jon,
    I'm getting the exact same error message that Sandra reported. Could this be an issue with the way Gallery's rss is configured? There are a few options in the gallery config, but I don't know too much about that stuff. How do you have your gallery rss options set up? FWIW, I'm using gallery 1.4.4-pl6.
    Thanks!
  • jon
    The plugin displays whatever the RSS for gallery will give you. If i recall correctly, gallery 1.5 will have more robust RSS support, but for now, I believe gallery only gives you the album highlight images that were last updated.

    j.
  • Hi, just discovered your excellent plugin, but is it me or does it only display one image from each album? When I point it this feed (http://hosted.gothikon.com/jmax/gallery/rss.php) from a gallery with only one album it only displays one image. However if I point it to my own gallery RSS feed (http://pictures.gothikon.com/rss.php) which has multiple albums it displays the number of images I request.
  • very nice plugin Jon. i was able to get this working with MovableType pretty easily.

    check my blog @ UrbanWordz.com. My gallery is small right now as i just installed it.

    lj.
  • jonmadison
    this is great news. i'm curious about (and have been at least researching) gallery 2, because i like it a bit more so far. i'm hoping that the RSS support will be available there as well, as opposed to hooking into the API to do what this plugin does.

    thanks again for letting me know!

    j.
  • h0bbel
    Just wanted to let you know that the next version of Gallery 1.x (Gallery 1.5) will allow you to have an rss feed for each seperate album, so you could limit the output from your great plugin to one album only.
  • jon
    Since the first release, i haven't had any errors actually *using* the plugin (i've had aesthetic issues, that we've discussed above :)

    i'll have to look into this as well.

    when you say

    I thought I’d followed suggestions to avoid it correctly


    you did this by modifying the php code?

    i'm not familiar with what the Magpie folk say to do to avoid it, so i'll have to look it up--i'll let you know.

    j.
  • Sorry to bother you again... but do you ever get the following error when your page loads?
    "Warning: MagpieRSS: Failed to fetch http://www.stewartville.org/gallery/rss.php. (HTTP Response: ) in /home/.ike/stewartville/stewartville.org/news/wp-content/plugins/magpierss/rss_fetch.inc on line 239
    Warning: Invalid argument supplied for foreach() in /home/.ike/stewartville/stewartville.org/news/wp-content/plugins/gallery_rss.php on line 128"

    I've looked online a bit, like Magpie FAQ, etc. and it seems like if it can't access the rss.php, then there should be a way to have the cache loaded rather than report the error. I thought I'd followed suggestions to avoid it correctly, but I still get the error quite frequently when my page loads. A refresh usually fixes it, but not always.
  • jon
    I'm actually having some issues with the display of multiple thumbnails under certain situations as well (that's why i'm only showing the ul view right now on my front page)--i need to build up my css chops. i'm showing two in "ul" mode--the only issue i have with the "recently updated photo", is that my portrait pictures get squished, because the plugin reads the first values for the width and height, as opposed to each image, because of a Magpie limitation--however, see comment #8 for a hack to Magpie and this plugin to get it to work properly.
  • I found someone who had done a Gallery rss.php file which sorts by most recent photo added, at least now that I'm using it seems to work that way with your plugin. Here is the link:
    http://www.bovine.net/~jlawson/gallery/rss2.phps

    I saved that file as rss.php in my Gallery install directory.

    I've only got one actual size thumbnail showing with "ul" layout because with four thumbs and the "div" layout the rest of my sidebar kept getting thrown off whack... if I knew more about css it probably would be really easy to fix... but for now I'm happy with at least the one "most recently added" photo showing up.

    Thanks again.
  • jon
    you know what, sandra, this is a function of the actual gallery rss module. the way it updates is interesting. basically any little thing you'd do to a gallery makes the rss file itself show an update (if someone leaves a comment, you rename a gallery, etc.) -- i think it'd be better if there existed an RSS that was triggered *only* by picture updates...i'm looking into this, as i look to make some enhancements to the plugin...

    if you happen to come across a module for gallery 1 that allows custom RSS feeds, you should be able to point to one of them in the plugin and it'll read that instead (although there's no guarantee that the format of said RSS would match the "standard" rss.php that comes with gallery).

    hope this helps!
  • This looks pretty cool. What am I doing wrong if the photos that show up aren't the most recently added ones? They seem to just be random photos.
  • jon
    I am sure it would be fine. I would say for "most" people, something simple is the way to go.

    For my purposes, menalto gallery works perfectly as well.

    Particularly since I am familiar with it (always a top consideration)

    Gallery will allow me to allow friends to place their photos up as well.

    and there exists an iPhoto to Gallery plugin.

    Wait a second--why are we discussing the merits of gallery software? I just wrote a plugin that serves *my* purposes. :)
  • I agree with Ryan Simple Php Gallery will be fine. No need of special extension activated on the server except GD 2 functions which is current.
    (excuse my poor english)
  • I'd suggest checking out 2 projects:

    Simple PHP Gallery (with built-in support for Wordpress)
    http://www.relativelyabsolute.com/spg/

    SimplePie (a super-simple RSS parser)
    http://www.skyzyx.com/projects/simplepie/
  • jon
    Tara, the trick was, you talked about it over pizza. me and pizza are like this:-)

    Jaibharat, thanks for the hacks! I'm going to wait until Magpie properly implements attributes (hopefully you've contacted them with your changes!) before updating the plugin.

    thanks again!

    j.
  • holy cow... I think you read my mind. I was talking about something like this over pizza the other day and then poof! you did it. Awesome. I'll be playing with it soon :D
  • Thank Jon. I implemented a temporary hack. I posted the details here.
  • jon
    You know, jaibharat--if i find out how to use attributes--i would be set, as I would rather use the width and height on each of the photo tags, instead of the initial image tag. That was my original desire, but I found no way to use attributes with Magpie RSS.

    Looking at the magpie RSS website, it appears that attributes are not currently supported. From the TODO section:


    Improve support for modules that rely on attributes


    j.
  • My bad. I created an album, but didn't add any photo. So if the recent album is empty, "gallery" with not generate "image" element. Now I could get it to work. Can please let me know if there Is a way to read attributes with magpie rss ?
  • I mean Element <h;pb:thumb height="113" width="144">
  • Hi,
    I'm trying to get this work. In my wp-sidebar template i'm calling < ?php echo gallery_rss(4, '', 0, 1.0); ?> < />. But always width and height are zero. I think because you are calling $rss->image and I don't find any "image" element in rss generated by "gallery". Element < pb : thumb > and height attributes. Shouldn't we read those values instead. Am I making any sense ? Please let me know where I'm going wrong.
  • jon
    Hi! Assuming you've set it up according to the "INSTALL" instructions in the source code, and have activated the plugin in your Plugins section in Admin, here is how i am calling it in my template to display in the sidebar on the front page:


    <li>
    < ?php echo gallery_rss(4,"",0,0.50,"div"); ?>;
    < /></li>
    on, and one i need to add to the instructions! Thanks for the checking this out, and your swift feedback!
  • phi
    Interesting piece of code.. I cant however get it to work.. Im sure im calling it the wrong way from inside the index.php - any directions how to do this?
  • joy
    saweet! You are a genius. That's why I love you:) A mad genius, but a genius none the less:)

    Take and shower and hurry up, we've got places to go, people to see!!!!!
blog comments powered by Disqus