10

Sep

Nice Feature Contributions to Shashin

Topic: WordPress and Web Programming
Tags: ,

Brian Hsu has made some nice enhancements to Shashin. You can see his post in the WordPress forums describing his additions. I posted a reply there, but I also want to mention it here, as I’d like to hear from other Shashin users to find out what you think of his additions. I haven’t made up my mind yet, but right now I’m thinking I’ll include all of his enhancements in the next Shashin upgrade. However, I’ll make it so the Picasa link-backs are turned on or off in the Shashin Settings menu, instead of extending the argument list in the Shashin tags (as the arguments lists are already quite long). Use the comments below to let me know what features you like (or don’t like) that he added.

23

Aug

Shashin 2.2 - Slideshows and Built-In Video Display

Topic: WordPress and Web Programming
Tags: ,

Shashin was overdue for an upgrade. The new version incorporates the latest version of Highslide, which means the big new feature is slideshows (scroll to the bottom of my Shinjuku Gyoen post to see a slideshow in action). I made the addition of the slideshow buttons automatic, which means if you’re already a Shashin user, you don’t need to do anything to enable slideshows in posts you’ve already written.

The other major new feature is that Shashin can now play Picasa videos locally in a Highslide window. This is also automatic. If you already have video thumbnails in your posts, and you’ve selected Highslide for viewing full size images in the Shashin Settings menu, then the videos will now play locally in a Highslide window. Here’s an example.

A word of caution if you put a video within a slideshow of other images: the video will load up and start playing, but if the length of the video exceeds the length of time that’s set for displaying each image, the video will stop and the next image will be loaded. There’s no way around that.

Other new features include:

  • New options in the Settings menu for autoplaying Highslide slideshows, how long to display each slideshow image, and the dimensions for displaying videos.
  • Checks for shashin.css and highslide.css in your active theme directory - this allows you to customize the stylesheets without worrying about losing your customizations the next time you upgrade Shashin.
  • No longer necessary to update image paths in highslide.css if you have WordPress installed in a subdirectory on your site (unless you choose to put a custom version of highslide.css in your theme directory - then you need to update the image paths to point to their location in the plugins directory).
  • For the caption in Shashin’s tags, in addition to “y” or “n” you can now use “c”, which means all pictures will get the caption “Click picture to enlarge” and all videos will get the caption “Click picture to play video.” The actual caption will be displayed in the Highslide window.
  • Option to make thumbnails not clickable, if you don’t want to display a larger version.

You can download Shashin 2.2 at wordpress.org.

Important note to upgraders: Deactivate your old installation, upload the new version, and then reactivate. This is necessary for required updates to the Shashin tables. Also, you need to sync all your albums - click the “Sync All” button (under the “Manage” tab).

27

Apr

Shashin 2.1 - Easier Steps for Displaying All Album Photos

Topic: WordPress and Web Programming
Tags: ,

Shashin 2.1 is now available. It does not include any new dazzling features, but it has a new, easier to use option for displaying all your album thumbnails, and then have them link to a page on your site that displays all the photos in each album. The Shashin page has instructions on how to do this.

There were 3 problems with how I implemented this feature in the previous (2.0) version of Shashin, but they only became clear to me after hearing feedback from people using Shashin 2.0 in a wide variety of WordPress themes. One problem was that the steps involved were just too complicated for most people’s needs (but the more complex options are still there, if you need greater control of the configuration than the new “easy” way).

The second problem was my attempt to manipulate the title of the page containing the [salbumphotos] tag. Shashin 2.0 tries to dynamically append the title of the selected photo album to the page title. In a rational world this would be easy, but WordPress makes it extraordinarily difficult to isolate and manipulate the title of a page, as reported here. I thought I had come up with a work around. But, as it turns out, my solution was not reliable across all the different WordPress themes that are out there. So, with Shashin 2.1, I have removed all the code that tries to manipulate the page title. It now simply displays the album title as a caption on the table that contains the photo thumbnails. This is much cleaner and shouldn’t cause conflicts with any themes.

The third problem was the [salbumphotos] tag, which is used to display thumbnails for all the photos in an album. In Shashin 2.0, a page with the [salbumphotos] tag won’t play nicely with sidebars that use the wp_list_pages function (for listing links to all the pages on a site). The [salbumphotos] tag only worked correctly if you used it in conjunction with Shashin album thumbnails. You couldn’t just go to the page directly from a sidebar link. This is fixed in Shashin 2.1.

Shashin 2.1 also has a few minor bug fixes, the most important of which is that you can now once again see the photo thumbnails in the Shashin admin panel.

I should point out that, if all you want to do with your Picasa photos in WordPress is display your album thumbnails on a page, and then link them to a page that displays the photos in each album, then I recommend kPicasa Gallery. It has similar features to Shashin in this area, but without Shashin’s management overhead. But if you want to do more than just that, then I recommend Shashin ;-) .

2

Apr

…And …And …Shashin 2.0.4

Topic: WordPress and Web Programming
Tags: ,

This is a very minor release in terms of code changes. It’s not critical if you have a previous version of Shashin installed, but it is critical if you’ve upgraded to Wordpress 2.5 and you’re installing Shashin for the first time. It has to do with WordPress 2.5’s new handling of variable scope when activating plugins (if you were curious).

The only other change I made was to add mp4 as a video type that Shashin will recognize (it’s not documented as a supported video type for Picasa, but it does in fact accept them).

Download Shashin 2.0.4.

Update: I’ve received a few reports from first-time Shashin users who are having trouble activating Shashin properly, despite this fix. This seems to be happening to only a small number of people, and I haven’t been able to track down the cause yet. If you are having trouble with Shashin under WordPress 2.5, please leave a comment on this post and let me know exactly what’s going wrong.

25

Mar

…And Now Shashin 2.0.3

Topic: WordPress and Web Programming
Tags: ,

In version 2.0.2 I updated Shashin to accommodate changes in the Picasa RSS feed. The feed changes had caused images to stop displaying after you synced your albums in Shashin. I fixed that, but what I didn’t notice was that they also changed how videos are represented in the feed, so version 2.0.2 still doesn’t display videos after you sync your albums. Someone kindly pointed out the problem, so I’ve fixed it - Shashin 2.0.3 is now available at wordpress.org.

21

Mar

Shashin 2.0.2 - Critical Upgrade

Topic: WordPress and Web Programming
Tags: ,

Murphy’s Law is being strictly enforced today: within 24 hours of my 2.0 release, Google coincidentally changed the Picasa RSS feed. The URL for the photos isn’t where it used to be in the feeder, with the result that, if you sync your albums in Shashin, your photos won’t show up anymore. I’ve found the new tag for the photo URLs in the Picasa feed and updated Shashin accordingly. So download Shashin 2.0.2 now. Note that your photo data is still safe in Shashin even if your photos stopped appearing after the Picasa RSS feed change. Syncing the albums with 2.0.2 should straighten everything out.

This is the one real problem with building an application that relies on Google’s RSS feeds - I have no control over when they might change the feeds, or what kind of changes they make.

There are also some other minor fixes. Here’s a list of the changes in 2.0.2:

  • Adjusted for new location of the content_url in the Picasa feed
  • If you select the option to display your photos at Picasa in a new browser window, it actually works now ;-) (the formatting of the anchor tag was incorrect).
  • Shashin now performs a preg_escape when detecting the URL for the page containing your salbumphotos tag. This fixes a warning that was being displayed for some URLs in PHP 5.
  • Shashin now correctly detects your WordPress installation directory if you’ve installed it in a subdirectory (except for paths in shashin/display/highslide.css which are hardcoded - you’ll need to edit those by hand).

19

Mar

Shashin 2.0 - Highslide and Album Displays

Topic: WordPress and Web Programming
Tags: ,

Shashin 2.0 is now available. I jumped the version number to 2.0 because this release includes a couple major new features. One is that Shashin is now bundled with Highslide. It was a fun challenge getting WordPress to play nicely with Highslide for displaying any combination of photos in a post, and then any combination of posts on a page. The other major new feature is linking album thumbnails to a local display of the album’s photos, so you can show them on your site instead of having to go to Picasa.

There are minor new features too: a new tag that lets you display sets of album thumbnails alongside their titles and descriptions, an option to prefix album titles to photo captions, and if you choose not to use Highslide, you can open the links to Picasa in a new window if you want.

All the details, including instructions for using the new features, are on my Shashin page.

If you have any questions or run into any problems, please use the comments on this post.

17

Feb

Shashin 1.2.3 - Several Bug Fixes

Topic: WordPress and Web Programming
Tags: ,

In my announcement of Shashin 1.2 the other day, I said I didn’t have as much time for testing as I would have liked, for the sake of getting out a version that works with WordPress 2.3.3. Sure enough, there were several bugs in Shashin 1.2. Get the fixes in version 1.2.3 from wordpress.org.

It may fix the problem some people were reporting with adding and syncing albums (a problem I haven’t been able to reproduce, so I can’t say for sure). If you had this problem, please let me know if the new version fixes it for you.

I also took the opportunity to rewrite the algorithm for displaying random photos, and it works much more nicely now, so give it a try.

I believe I may have also found why some, but not all, Shashin users were having trouble with multibyte (e.g. Chinese) characters, so this upgrade may help with that as well.

If you have any questions or problems, please post a comment on this post.

14

Feb

Shashin 1.2 Now Available

Topic: WordPress and Web Programming
Tags: ,

Update: There were some bugs in this version, please see my post on version 1.2.3 for the latest update. Also go there for any comments or questions - I’ve turned off further comments on this post.

You can download the latest version of Shashin from wordpress.org. I had to rush this out the door, since Shashin 1.1 doesn’t work with Wordpress 2.3.3. That means I didn’t do all the testing I usually do before a release. If you have any problems, please post a comment here (note I turned off comments on the main Shashin page, as the page was just getting way too long).

The two big new features happen to be the two most requested features: displaying groups of album thumbnails, and the ability to add or sync all your Picasa albums at once. For the album thumbnails, they are displayed in a table with a number of columns you can specify, you can choose to display either only certain albums, or all your albums with your choice of sorting preference, and you can choose whether to display the album titles and locations (if you specified a location in Picasa, Shashin will include a Google Maps link as well). Syncing all your albums at once will make using Shashin easier for those who maintain a lot of Picasa albums.

Another feature I added is smarter album syncing. Now if you move a photo from one album to another in Picasa, Shashin will preserve its original photo key when it syncs the albums. Before I made this change, the old photo key would be deleted and the picture would get a new photo key, thus breaking any Shashin tags that referred to the old key. That problem won’t happen anymore.

The biggest piece of work in this release wasn’t the new features though. It was writing a parser for the Picasa feed from scratch. I got tired of Shashin breaking every time WordPress changed its RSS tools (which seems to happen with almost every new version - that’s what broke Shashin 1.1 when WordPress 2.3.3 was released). Instead of using something big like Magpie, I instead wrote a very lean XML parser - not counting comments, the whole thing is less than 60 lines of code. It uses Snoopy to load the feed, since I can’t rely on PHP functions like fopen being configured across different servers for URL fetching (Snoopy comes with WordPress, so Shashin loads it from there). I would have loved to write the parser in PHP 5, which has a great new set of tools for XML, but a lot of sites out there are still on PHP 4 (including mine), so the parser is PHP 4 friendly.

I’ve noticed my old rss-functions-mod.php file being re-used by folks in other WordPress plugins. That code doesn’t work with the new version of WordPress (I didn’t bother to investigate why, since I was done working on the new parser anyway). If you’re someone who’s used that file in your plugin, you may want to switch to the parser that’s included with Shashin 1.2. But you’ll need to make some adjustments to your plugin, as the data that comes out of the new parser is in a different structure.

Stay tuned for version 1.3, probably in a few weeks. I’m planning to include Highslide integration! :-)

13

Feb

Shashin 1.1 Incompatible with WordPress 2.3.3

Topic: WordPress and Web Programming
Tags: ,

Wordpress 2.3.3 was released about a week ago. I haven’t upgraded yet, but I just heard from a Shashin user that Shashin isn’t working with the new version. It sounds like it actually breaks the whole site - that you’ll only get a blank page until you deactivate Shashin. I will install the new Wordpress version today so I can start investigating what the problem is.

I actually have version 1.2 of Shashin almost ready. One major change is that I completely rewrote the parser for the Picasa RSS feed (so it’s no longer relying on my hacked version of the old WordPress rss-functions.php file). If I’m lucky, whatever the problem is with 1.1’s compatibility is already gone in my 1.2 code. But I’m not counting on it ;-) .