Projects

smugmugRSS Plug-in

Download (v1.1)

This plugin allows you to display images hosted on Smugmug on your WordPress site. It uses the built-in MagpieRSS that comes with WordPress to parse the RSS feed and display the images. This is my first attempt at a WordPress plugin, and while I am a developer by trade, I am admittedly not a PHP expert, you’ve been warned!

Installation

  1. Put smugmugRSS.php in your plugins directory
  2. Activate the plugin
  3. Configure your settings via the Options panel

How to Use (in templates, pages or posts)

  1. Add <?php get_smugmugRSS(); ?> somewhere in your templates if you want the default values available in Options
  2. Add the code with full parameters <?php get_smugmugRSS(rss_url, num_items, display, before_block, after_block, before_image, after_image, before_caption, after_caption); ?> if you’re a control freak.

FAQ

  1. What feeds are supported?
    This plug-in only supports RSS feeds. Smugmug offers both ATOM or RSS. Use rss200 in the format parameter.
    For a full set of Smugmug Feeds, visit Smugmug’s Wiki page. I have tested this with Recent Galleries, Gallery, Keyword, Popular Photos. and Recent Photos.

  2. How do I specify image size?
    Smugmug allows for a Size parameter. Use any Smugmug supported Image Size: thumbnail, tiny, small, medium, large, original, or any of the shortcuts. It will even support custom image sizes, i.e., 100×100.

  3. Can I use this within my posts? or do I have to modify templates?
    Using another plugin like runPHP or PHPExec, you should be able to use this within your posts and templates. Here is my blog showing some exampes of the plug-in use. Blog showing use of smugmugRSS within a post.

Advanced

The plugin also supports a number of parameters, allowing you to have multiple instances across your site.

  1. rss_url – Feed URL
  2. num_items – Number of Images to display. Use 0 to display ALL
  3. display – tells the plug-in to display: image only (0), caption only (1) or both (2)
  4. before_block – this is the HTML to apply before the whole block, normally used for sidebar (titles) and opening <ul> tag
  5. after_block – this is the HTML to apply after the whole block, normally the closing </ul> tag
  6. before_image – this is the HTML to apply before the image, i.e., <li> tags or <div> tags
  7. after_image – this is the HTML to apply after the image, i.e., </li> tags or </div> tags
  8. before_caption – this is the HTML to apply before the caption, i.e., <span> tags or <div> tags
  9. after_caption – this is the HTML to apply after the caption, i.e., </span> tags or </div> tags

Example 1

<?php get_smugmugRSS('http://mnmdl.smugmug.com/hack/feed.mg?Type=nickname&Data=mnmdl&format=rss200&Size=100x100', 10, 1); ?>

This would show the 10 most recently modified galleries, displaying captions only.

Example 2

<?php get_smugmugRSS('http://mnmdl.smugmug.com/hack/feed.mg?Type=userkeyword&NickName=mnmdl&Data=featured&format=rss200&Size=100x100', 0, 2, '', '', '<div style="width:150px;height:200px;overflow:auto;float:left;text-align:center;">', '', '<p>','</p></div>'); ?>

This would show ALL photos tagged with keyword: "featured", displaying both images and captions with the provided HTML formatting/layout tags.

Example 3

<?php get_smugmugRSS('http://mnmdl.smugmug.com/hack/feed.mg?Type=gallery&Data=2384562&format=rss200&Size=100x100', 3, 0); ?>

This would show 3 photos from a certain gallery with AlbumID: 2384562, displaying captions only

Feedback and Support

This plug-in is not officially supported. If you have any questions or issues, try and reach me through http://dgrin.com, username: MnM


Plugin History

Latest Release: February 9, 2007

  • 1.1 – Added images and captions display, and flexible formatting tags
  • 1.0 – Initial release

2 comments to Projects

  • Hello,
    Is it possible to get a random image from a smugmug gallery? I’m trying to use your plugin for a ‘photo-of-the-day’.
    Thanks,
    Will

  • marie

    if you just want a random image for a particular gallery – you just need a standard IMG tag using /photos/random.mg?AlbumID=[Album ID]&Size=Tiny&AlbumKey=[Album Key]&rand=[some unique#]

    I use this on my header – if you notice, they’re random images pulled from galleries. They change everytime the page is refreshed.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>