Shashin 2.4 Beta Available
Update 5/29: Beta testing is done, and Shashin 2.4 is now available for download at WordPress.org
Shashin 2.4 has several new features that people have been asking for. It’s available on my site only as a beta release. I’ll upload it to wordpress.org after I get feedback on the beta. If you can contribute a translation, a .pot file is included.
New features:
- Support for image viewers other than Highslide, such as Lightbox, Fancybox, etc.
- Display album photos using the order you’ve set in Picasa.
- Customizable pagination of album photos.
- New settings for customizing Highslide’s borders, navigation bar, and background color/opacity.
- Dynamically set thumbnail sizes and the number of thumbnail columns to suit your WordPress theme (this means you don’t have to worry about images being too large or small if you switch to a wider or narrower theme).
- Show camera EXIF data in Highslide captions.
- Improved usability for the Shashin admin screens, with detailed examples of Shashin tags.
- Align images and groups of thumbnails to the center.
- Specify an alternate image to use as a thumbnail – this is often useful for videos.
- Includes the latest version of Highslide (4.1.4)
Download Shashin 2.4 Beta
Upload the new files, deactivate and reactivate Shashin in your plugins menu, and then go to the Shashin settings page to configure the new features. There’s help text there, which should be sufficient for most of the new features, but a few require more explanation:
- Dynamically setting thumbnail sizes: if you indicate the width of your theme’s content area in the Shashin settings menu, you can use the word “max” instead of specifying a Picasa image size in your Shashin tags. Shashin will then figure out which Picasa image size to use. This is very useful because it means you won’t have to go back and edit all your tags if you change to a wider or narrower theme in the future. For example, if the width of your theme’s content area is 610 pixels, and you use “max” with the simage tag for a single image, Shashin will pick 576 as the image size (the largest Picasa size that will fit in the available space). If you use “max” as the image size with sthumbs, srandom, or snewest, Shashin will do the math to determine the correct size for the thumbnails based on the number of columns you specified. Note that “max” doesn’t work well for photos with a portrait orientation, as the size will be applied to the height instead of the width.
- Dynamically setting the number of thumbnail columns: you can also use “max” to indicate the number of columns in sthumbs, srandom, and snewest. Shashin will figure out the number of columns based on the image size. For example, if you set the image size to 160, and your content width is 610, your thumbnails will be displayed in 3 columns. You cannot use “max” for the image size and the number of columns at the same time. Shashin needs one to be a number so it can calculate the other.
- Centering images and using alternate thumbnails: I actually slipped these in to version 2.3.5, and they are documented here.
The Shashin documentation page is not updated yet for the new features. I’ll update it after version 2.4 is out of beta.
Shashin 2.3.5 Now Available
I had hoped to finish version 2.4 by now, but I’ve been busy with other projects and haven’t had enough time for it. So I’m releasing 2.3.5, which will be the final patch for version 2.3. There were a few bugs that people discovered since the last patch, and I don’t want to delay getting the fixes out. You can download it from wordpress.org, or if you already have a previous version installed, your plugin menu should give you a link within the next 24 hours to automatically upgrade.
Patches aren’t supposed to have new features, but this has a couple small ones, since I had already finished working on them.
- In addition to floating left or right, you can use “center” as an option for positioning your shashin tags and widgets. For example:
[simage=600,576,y,center]
This gives the picture with key 600 a width of 576, shows the caption, and centers the picture. Shashin uses the CSS “margin-left: auto; margin-right: auto;” technique to center the picture. This means you can leave out the “clear” argument if you’re centering, as the subsequent content will be automatically pushed below the picture.
- The simage tag has a new, optional 6th argument, which lets you specify an alternate thumbnail image. This is particularly useful for videos, as sometimes Picasa is unable to generate a thumbnail (I’ve run into this with a couple of mp4 videos, where the Picasa-generated thumbnail is just a solid black image). You can see it in this post, featuring a video about my son's school in Japan a couple of years ago. The thumbnail is a still frame from the middle of the video. The syntax looks like this:
[simage=432,288,y,left,none,433]
The number at the end is the photo key for the thumbnail image to use. Note this option is available only for the simage tag.
These are the bug fixes:
- Fixed incomplete localization code for widget menus
- In the album photo admin menu, now correctly saves whether photos should be included in random display
- The salbumphotos tag can now handle sort order options with spaces (e.g. “pub_date desc”)
- The salbumphotos tag no longer shows a “go back” link, as there’s nothing to go back to
Shashin 2.3 Now Available at wordpress.org
Beta testing is now done, and Shashin 2.3 is available for download from wordpress.org. If you have the beta version, go get the final version from wordpress.org. Thanks very much to everyone who helped with testing – you found bugs that I had missed and provided helpful feedback on the new features.
Update 2/10: …even more bug fixes – version 2.3.4 is now available. A few people using Shashin with WordPress on Windows were having problems adding certain photos. This is fixed now (the problem had to do with photos that had no date indicating when they were taken – mySQL on Windows insists on having a date). Also, the [salbumlist] tag is now working again (I overlooked it in my previous testing). Lastly, you can now put more than one [salbumthumbs] or [salbumlist] tag on a page (it never occurred to me to try this, but someone wanted to, and now it’ll work).
Update 1/30: Yet another minor release is now available – version 2.3.3. I rewrote the album syncing method for faster performance. There should be a noticeable improvement when clicking “sync all,” especially if you have a lot of albums (or a lot of photos in your albums). I also fixed a bug – Shashin wasn’t correctly updating its photo data when an album was moved from one Picasa album to another. Shashin can now also handle a # character at the end of album URLs when adding an album (the # appears in certain Picasa links – it’s not actually part of the album URL, and it was tripping up the RSS feed).
Update 1/25: Another bug fix release is now available at wordpress.org – version 2.3.2. This is an important one, so please upgrade. You’ll need to deactivate and then reactivate Shashin after uploading the new version. It fixes a problem with albums getting added multiple times when you try to sync albums. It also fixes a problem with the album thumbnail widget – it now automatically links the album thumbnails to Picasa, instead of trying to load all your photos in the sidebar. And it includes the first localization file contribution – Shashin in Dutch!
Update 1/23: I just updated Shashin at wordpress.org with a couple of bug fixes (version 2.3.1). It wasn’t loading language localization files correctly, and in certain situations it was reporting a database error when there wasn’t one. Both problems are fixed.
Workaround for Using Unlisted Picasa Albums in Shashin
Update 2/14/2010: As of version 2.6, Shashin now has support for unlisted albums, so you no longer need the workaround described in this post.
There’s still no support for unlisted albums in the new version of Shashin, but there is a workaround. If you temporarily make your unlisted album public, then add it to Shashin, and then make it unlisted again, it will work in Shashin. If you later add photos to the album, you’ll need to briefly make it public again to sync it with Shashin. I was actually surprised this worked. Shashin is able to display the photos even without the authkey for the unlisted album. It seems that Picasa requires an authkey to access the Picasa pages that display the unlisted photos, but doesn’t require an authkey for the images themselves.
The reason I haven’t added better unlisted album support yet is that it’s more difficult to do than it might seem. I could use an album’s authkey to give Shashin access to an unlisted album’s RSS feed. However, Shashin also needs to access your Picasa user feed, which contains important metadata about all your albums. Unlisted albums don’t show up in the public version of that feed, even if an authkey is available.
To access that feed, I’ll need to give Shashin the ability to log in to your Picasa account. This is possible with the Picasa Web Album API. There’s an officially supported PHP library for interacting with it, but the problem is that the library is over 3MB in size, and I don’t want to bundle something that enormous with Shashin.
I wrote my own authentication routine using Google’s ClientLogin method for another project, but that approach isn’t appropriate for a distributed web application like Shashin. I’ll have to figure out their AuthSub method instead, which is intended for web applications. So… look for better unlisted album support in a future version of Shashin, and hopefully the workaround described here will get you by in the meantime.
Shashin 2.3 Beta is Here
Shashin 2.3 is a complete rewrite, with more robust error handling, improved security, and several new features. I’m initially releasing it on my site only, as a beta release. Update: The final version is now available for download at wordpress.org:
I’ve done a fair amount of testing myself, but since it’s a rewrite, there’s the possibility of new bugs where there weren’t any before, so I’m looking for help testing it before I make it more widely available on wordpress.org. Please use the comments section on this post to let me know if you run into any problems.
If you’d like to see an overview of the code, here’s the Shashin 2.3 phpdoc documentation.
Important installation instructions if you’re upgrading:
- Make a backup copy of your current Shashin files
- Deactivate Shashin
- Delete Shashin from your plugins directory (this will not harm your Shashin photo data)
- Unzip and upload the new version
- Reactivate Shashin
- Go to the Shashin settings page. You will need to reset your options (they’re stored in a different way in Shashin 2.3, and it doesn’t inherit from previous versions)
New features and how to use them:
- Automatic daily synchronization of all your Shashin albums with Picasa. This is turned off by default – you can go to the Shashin settings page to turn it on. This was the last feature I added and I haven’t tested it thoroughly, so I’d especially appreciate feedback on this.
- Internationalization: Shashin now comes with a shashin.pot file and will work with localization files you create. If you create a translation for Shashin, please send me your localization files and I’ll include them with the Shashin distribution.
- Simplified use of the [salbumthumbs] tag. If you’re using Highslide with Shashin, you no longer need a second page with the salbumphotos tag to display an album’s photos. Just click an album thumbnail, and the page will reload showing thumbnails of the album’s photos. On the Shashin settings page you’ll see a new set of options for specifying the thumbnail size, sort order, etc.
- Repurposed [salbumphotos] tag: you can now use it to show all the photos for an album, without having to first click an album thumbnail. This means the syntax has changed slightly – the first argument is now an album key:
[salbumphotos=album_key,max_size,max_cols,caption_yn,description_yn,order_by,float,clear]
- Improved usability for the Shashin admin menus. You can sort your albums and photos by clicking on different column headers. Also, Shashin makes use of the new styling options in WordPress 2.7 to make the album list easier on the eyes.
- The [srandom] and [snewest] tags used to require either a single album key or the word “any” as its first argument. You can now also provide multiple album keys. Here’s an example:
[srandom=3|7|2,288,2,6,n,none,both]
- For each of the Shashin widgets, you can now specify CSS “float” and “clear” values.
- Uninstall option: this will delete the Shashin database tables and delete all the Shashin options from the WordPress options table. You can never get your photo key and album key numbers back if you do this, so only uninstall if you really don’t like Shashin
Bug fixes, security fixes, and error handling:
- If you list multiple album keys or photo keys in a Shashin tag, they’ll now always display in the order you listed them.
- There were a number of minor bugs with Shashin widgets. I won’t list them all here, but it’s probably safe to say that if you noticed something that wasn’t quite right with one of the widgets, it’s fixed now.
- Better protection against SQL injection (this is a very low risk for Shashin anyway, since it doesn’t take user inputs through public-facing pages, but the extra protection can’t hurt).
- Removed an XSS (cross site scripting) vulnerability.
- In the admin panels, Shashin used to report the same error message regardless of what really went wrong. Now the error reporting is much more specific, which will make debugging much easier.
Acknowledgements
- Northclick’s excellent internationalization tutorial. I scoured the web looking for a guide to using xgettext for generating the shashin.pot file, and this was the only good one I found.
- Glenn Slaven’s guide to scheduling events in WordPress.
Update 1/21: the official release is now available at wordpress.org. Thanks to everyone who helped with testing! The download link above now points to wordpress.org.
Update 1/18: I’ve uploaded another revised version, thanks to a couple bug reports I received. You’ll need to deactivate and reactive Shashin for one of the fixes to go into effect (there was a datatype problem with the date fields, resulting in albums and photos not always sorting in the right order).
Update 1/16: the documentation is now updated for the Shashin 2.3 beta. Also, I found and fixed two very minor bugs. The download link below includes the fixes.
Shashin 2.3 Is Coming…
I’ve been getting more emails than ever about Shashin, and it’s been many months since the last version. I’m about halfway through a full re-write of Shashin. The new version will feature:
- Improved database security
- Internationalization
- Most (maybe all) of Brian Hsu’s feature additions
- Simplified approach to displaying all the photos in an album (you won’t need the salbumphotos tag anymore)
- Automated scheduled album syncing
- Various new tag options
- And, of course, bug fixes
Since it’s a full re-write, it will need some testing, so I’ll release it initially on my site only, as a beta version. So stay tuned – look for it in 2-3 weeks.
Nice Feature Contributions to Shashin
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.
Shashin 2.2 – Slideshows and Built-In Video Display
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).
Shashin 2.1 – Easier Steps for Displaying All Album Photos
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
.
…And …And …Shashin 2.0.4
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).
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.
