Latest MobileMe Photos Plugin for WordPress

Die deutsche Version dieser Seite gibt es hier.

What it does
Obviously it displays the latest uploads or changes from your MobileMe Webgallery. The Plugin displays a specified number of thumbnails which link to the detail page in your gallery.

Where can I get it
You can download it from the WordPress.org Plugin Directory.

How it works
The plugin retrieves the album information by fetching the MobileMe rss feed. Then it fetches feeds for every single album to get the photo details. Finally the details are sorted by date of last change and displayed. Since retrieving the feeds takes a moment the result is cached and only updated when there are changes. It still needs to fetch the albums feed from time to time in order find out if a full update is necessary. The update frequency can be specified in the widget settings.

What you need to get it working

  • You will obviously want to have your own MobileMe Webgallery to display photos from.
  • Make sure your webserver or blog hoster is running PHP5. I may consider creating a PHP4 version if there is enough interest
  • At the moment, you will need a wordpress version with widget support (and a theme as well)

Known Issues
Sometimes the square thumbnails are not displayed correctly. The MobileMe gallery seems to generate these thumbnails on upload but only if photos are uploaded via the MobileMe site or iPhoto. It seems there are no thumbnails created when photos are uploaded from your iPhone or sent to your gallery by email. I need more testing on this, please leave a comment if have more information on this matter.

What about the layout?
There is not much layout at the moment. On my website I used my theme to change the style of the plugin. The Plugin itself does not include any stylesheet for displaying the photos. If you have suggestions leave a comment.

Work in progress
This is my first plugin, please be patient if not everything works perfectly from the beginning ;)

40 Kommentare

  1. David Hutton sagt:

    I can’t get this to work? I’ve tried entering my MobileMe Username as davidhutton@me.com & also just as davidhutton. Checked my mobileme gallery is working fine. Still get an error message? Shame because I like the idea of this. Can’t understand why it’s not working?

  2. Kay sagt:

    The reason seams to be that you have only one photo in your gallery. Try adding more photos, I try finding a better solution.

  3. Rob Butcher sagt:

    This has great potential value to my site. The ability to snap a photo with my iPhone, send it to MobileMe and then have it automatically appear on http://www.KirklandViews.com would be wonderful.
    Thank you for your hard work.

  4. I’m having the same problem. My MobileMe is brekitomasson – or the same with an @me.com in the end; I’ve tried both, and uploaded a bunch of pictures to my gallery – but nothing. Just getting “Error: Images could not be loaded”

  5. Kay sagt:

    I just uploaded the 0.6 update. I got your account working with it on a local installation. With this version usernames with @me.com, @mac.com or without are supported.

  6. Huh; that’s strange. Mine still isn’t working – even after an update to 0.6

  7. I added echo count($photos); to where it outputs the error message, and it’s coming back with 0; so it seems like it’s not registering the fact that I have pictures in my MobileMe gallery.

    I’ve changed the four settings in the widget to:

    brekitomasson, 3, 125, 5

    just to check if it would update faster and be any better if there were only three images – still nothing.

  8. Kay sagt:

    The settings are correct, the problem might be that your website is unable to fetch the feed. If that is the case I cannot really do anything about it because I’m using wordpress functions for this.

    I will include some more debugging features, so it will be easier to track down the error.

  9. Kay sagt:

    You can try downloading the current development version at http://wordpress.org/extend/plugins/latest-mobileme-photos/download/

    This version will add some debugging information as html comment whenever the plugin fails to load the photos. With this I should be able to figure out what might be wrong on your site.

  10. I’ve changed to the development version now, but fail to see any debugging information in the HTML except what I saw previously:

    string(13) “brekitomasson”
    ["count"]=>
    string(1) “9″
    ["check_frequency"]=>
    string(4) “3600″
    ["last_check"]=>
    int(1232533411)
    ["last_update"]=>
    int(1232533411)
    ["size"]=>
    string(2) “50″
    }

  11. Kay sagt:

    I was probably too quick. The wordpress directory is refreshed every 15 minutes so the new version was not yet displayed. It should be online now, though. Try downloading it again.

  12. … and I added an RSS-feed of my mobileme gallery to the sidebar through WordPress’ own RSS-widget, and that seems to work without problems; so it’s not a problem with fetching the feed.

  13. Kay sagt:

    At the moment I don’t see any debug information at all. Are you sure you have the latest development version?

  14. I just removed the directory, downloaded the development version and reuploaded it… now I’m getting this:

    [0]=>
    string(31) “Username set to ‘brekitomasson’”
    [1]=>
    string(22) “fetching category feed”
    [2]=>
    string(58) “Fetching feed ‘http://photocast.mac.com/brekitomasson/rss’”
    [3]=>
    bool(false)
    [4]=>
    string(22) “fetching category feed”
    [5]=>
    string(58) “Fetching feed ‘http://photocast.mac.com/brekitomasson/rss’”
    [6]=>
    bool(false)
    [7]=>
    string(18) “parsing album urls”
    [8]=>
    string(12) “invalid feed”
    [9]=>
    string(15) “total: 0 photos”

  15. Kay sagt:

    The magpie feed library that wordpress uses fails to the feed for some reason. The url is correct but the fetch_rss function returns false.

    I’m running out of ideas here. You can try adding

    define(‘MAGPIE_DEBUG’, 3);

    to the plugin and see if magpie displays some error.

  16. So it seems… I’ve been digging in rss.php and adding some debug fields of my own, and it seems like it fails at this part of the fetch_rss call:

    if ( !MAGPIE_CACHE_ON ) {
    // fetch file, and parse it
    $resp = _fetch_remote_file( $url );
    if ( is_success( $resp->status ) ) {
    return _response_to_rss( $resp );
    }
    else {
    return false;
    }
    }

    So why wouldn’t the magpie cache be on? How/where do I change this?

  17. I found it in your addon, changed MAGPIE_CACHE_ON to 1, and the rss.php-error I told you about disappeared … still not getting the feed, though, so I’ll dig deeper.

  18. Kay sagt:

    The problem is not that the cache is on but that the _fetch_remote_file( $url ) call does not work.
    The is_success( $resp->status ) is false so the whole functions returns false.

    So the remote http request doesn’t work. Try doing an
    echo $resp->status;
    before returning false. Perhaps we can find out why the request fails.

  19. Sorry for spamming like this; but I really want to get this plugin working; it’s exactly what I’ve been looking for. :-)

    I asked rss.php to output out the cache status inside fetch_rss, and it outputs MISS. Does this help you in any way? It would seem to signify that it doesn’t find a good feed at the URL.

  20. echo $resp->status gives a 302 error, by the way.

  21. Kay sagt:

    MISS means, that the file is not in cache and that the feed will be loaded. That is a good thing.

    302 is a redirection. This is correct because the feed address that i use redirects to the actual feed. But this is usually not a reason to abort.

  22. Yeah; I figured that as well, but why wouldn’t it be following the redirect?

    I added the built-in RSS widget to my sidebar and inserted the URL just like it it output from your addon – http://photocast.mac.com/brekitomasson/rss – and that gives me a “Error: could not find an RSS or ATOM feed at that URL.”

    If I change the feed address to http://gallery.mac.com/brekitomasson/?webdav-method=truthget&feedfmt=recentrss&maxrec=12 however, it works…

  23. Kay sagt:

    Ok. Then try changing the $categoryFeedPattern on line 141 to

    var $categoryFeedPattern = “http://gallery.mac.com/–username–/?webdav-method=truthget&feedfmt=recentrss&maxrec=12″;

    Perhaps that works.

  24. Same, same. :-/

  25. And in the latest version it started working. Thank you! ;)

  26. Sean Bailey sagt:

    How can i easily center the photo block in Editor? I am not a very good programmer, check out my site you will see why i want it centered.

  27. Kay sagt:

    I just had a look at your site. The easiest way might be to just add a line to the stylesheet of your theme:

    #MMPhotos { padding-left: 10px; }

  28. Shannon sagt:

    thanks for making the plugin. It’s a great addition to my site. There is one thing I noticed that I thought I would pass along. It doesn’t seem to regularly update. I add new photos to my mobileme site fairly regularly, but don’t see those updates automatically reflected in this widget, even after several days.

  29. Eric Neumann sagt:

    I noticed that the refresh does not work either. So I have to go into my WordPress control panel, click on widgets, then click on “save changes” and then the gallery widget is updated. Until there is a fix, I will just do that. Awesome widget though! Great job! It was very hard to find anything that will do something like this for WordPress so I want to thank the developer.

  30. Bud sagt:

    Using version 0.7, it has been working fine for a long time. but it now has an error message:

    Error: Images could not be loaded.

    has something changed?

  31. catherine sagt:

    very nice plugin ! Thank you !!

    one little question: how do I get the photos to open in a new window ? I can’t find where to change the code…

    catherine

  32. Kay sagt:

    easy one :) just click the image with your middle mouse button. or if you don’t have one cmd-click on the image (or ctrl-click on windows)

  33. catherine sagt:

    :)
    yes, thank you, but what i am looking for is more : target=’_blank’… !
    no idea where and how to write it in the php file !

  34. catherine sagt:

    :)
    yes, thank you, but what i am looking for is a target=”_blank”, but i have no idea of how or where to put it in the php file !

  35. catherine sagt:

    oups
    :)
    i am repeating myself

  36. Kay sagt:

    Hm. If you want to change it yourself open the php file, and put it into the a-tag. It is constructed at line 123, you can just put your target in there. I’m not going to put it in the official version, because it wouldn’t validate to xhtml strict anymore.

  37. catherine sagt:

    thank you very much !!

  38. Sven sagt:

    Thanks for the great plugin. I am having a problem and hope you can offer advice.

    The plugin works fine in my sidebar – images are retrieved and displayed perfectly. But I would like to display a mobileme gallery in page content body. When I try this use widget in this way the plugin fails without error message. I am new to WordPress development, so any help is appreciated.

    Thanks again for the plugin. Great work!

  39. Plugin works well as a widget. Is there any way to embed the gallery into the site permanently? Not as a widget? Thank you …

  40. Cindy sagt:

    Works great for me! Danke!

Schreibe einen Kommentar

Und was sagst du dazu? Hinterlass einen Kommentar und lass es mich wissen. Achte darauf, dass die Felder, die mit einem * gekennzeichnet sind, alle ausgefüllt werden. Die Email Adresse wird nicht angezeigt, zum spammen werd ich die auch nicht benutzen und weitergeben auch nicht.

Noch keinen Gravatar? Richte dir hier einen ein!