Posts By Mike

A Question for Shashin Users

I’m considering adding a new syntax for Shashin’s shortcodes, and I’d like to hear from Shashin users about it. The current format is compact but not easy to remember. For example:

[srandom=3|7|9,288,2,6,n,left]

It’s also not compatible with the newer shortcode syntax that WordPress currently supports and recommends. I’m thinking of switching to the recommended syntax. So the equivalent shortcode for the above example would be something like:

[shashin type="random" albums="3,7,9" size="288" cols="2" count="6" caption="n" position="left"]

The reason I didn’t use this syntax originally is because it’s a lot more typing. So to make the typing easier, I would also add editor buttons, for both the Visual and the HTML editors. There’s a standardized way to add buttons to the Visual Editor already, and my Koumpounophobia plugin makes it easy to add buttons to the HTML Editor (having buttons for Shashin was my inspiration for creating Koumpounophobia).

New versions of Shashin would have an option to support the old syntax, so you wouldn’t have to rewrite tags in old posts.

So, if I added the new syntax and editor buttons, would you use them, or would you prefer to keep using the old syntax? Please leave a comment and let me know.

Minor Upgrades for Shashin and Deko Boko Available

This morning I uploaded minor upgrades for Shashin and Deko Boko to wordpress.org. The Shashin upgrade adds back the getAlbumList function I inadvertently removed in Shashin 2.3. It provides a non-widget solution for showing a Picasa photo album list in your sidebar. The Deko Boko upgrade offers new translations in Spanish and French, and fixes a small bug in the Settings menu (it would show English as the selected language even if you had picked a different one).

Shashin and My Other Plugins Compatible with WordPress 2.8

I just upgraded to WordPress 2.8, and all of my plugins are working fine with it so far. The only problem I’ve noticed is the headers on the Koumpounophobia modal dialogs are no longer styled correctly, but the functionality is fine. If you notice any upgrade-related problems, please add a comment to this post.

And while I’m here: Shashin was one of five image-related plugins (out of the 285 available at wordpress.org) listed in the Weblogs Tools Collection’s article Five Image Related Plugins for your WordPress Site.

(My blog has been quiet recently as I’ve got a big home renovation project going. I’ll post pictures when it’s done. I may not have the opportunity to blog much this month.)

Shashin 2.4 Available at WordPress.org

Beta testing is done, and Shashin 2.4 is now available for download at WordPress.org. The beta version was downloaded 54 times and no bugs were reported. For a description of the new features, see the post announcing the beta version. Russian and Dutch translations are included in the new release. Thank you to everyone who helped with the translations and with testing.

I’m almost done updating the Shashin documentation page. I’ve finished documenting the most important new features. I’ll finish the rest in the next few days.

If you encounter any problems or have any questions, please add a comment to this post.

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.

Deko Boko 1.2 Available

Deko Boko is a WordPress contact form plugin. You can add any optional or required fields you want to the contact form, simply using HTML. It includes a “CC Me” option, it uses reCAPTCHA for handling spam, and it protects against XSS and email header injection attacks.

New in version 1.2:

  • You can have Deko Boko load its stylesheet only on pages where you use the Deko Boko contact form, so it won’t be loaded unnecessarily on other pages.
  • Localization support: a dekoboko.pot file is included to enable translations to other languages.
  • If you want to make a custom contact form, a template is included to get you started.
  • If you want to customize the dekoboko.css stylesheet, you can place it in your active theme folder, and Deko Boko will find it there (that way you won’t lose your stylesheet customizations when upgrading Deko Boko).
  • Uninstall option.
  • Uses a nonce field for additional security.

You can download Deko Boko from wordpress.org.

Important note to upgraders: you will need to deactivate and then reactivate Deko Boko after you upload the new files. Also, the contact form now uses a nonce field for additional security. If you have made your own contact form template, you will need to add a nonce hidden input field, like this:

<?php wp_nonce_field('dekoboko_nonce', 'dekoboko_nonce'); ?>

Update 5/12: I’ve released a bug fix, version 1.2.1. It fixes an installation bug: Deko Boko wasn’t installing properly if you didn’t already have the WP-reCAPTCHA plugin installed. It will now install correctly with or without WP-reCAPTCHA already installed.

Koumpounophobia 0.4 Now Available

Koumpounophobia is a WordPress plugin that enhances the HTML Editor in several ways, giving you new buttons, modal dialogs, and the ability to add your own buttons.

The new version 0.4 is compatible with Internet Explorer 7 and 8. It also fixes the “scroll position” bug in Firefox 3 (the editor no longer scrolls to the top after you use a Koumpounophobia modal dialog). It’s available for download at wordpress.org.

Getting it to work with Internet Explorer took a lot of research, but in the end it required only a few additional lines of code. The problem was that IE would forget the cursor position in the editor when you used a modal dialog, causing your tag to always be inserted at the beginning of your post. If you do a search for “textarea cursor position” you’ll see a lot of electrons being spilled by others trying to solve this problem for their own projects. I’ll write a separate post on this, as the solution in many cases doesn’t require the dozens and dozens of lines of code that a lot of people are using.

Web Consulting Projects Wrap-Up

Last year I had several web consulting projects. I just finished the last of them, and I’m not planning on doing any more, so I figure now’s a good time to post a wrap-up. All 5 of these sites are running on WordPress.

[sthumbs=486|617|616|506|618,160,3,y,center]

  • Body of Knowledge Personal Training: the most interesting part of the site is accessible only by their clients. I created a custom WordPress plugin that enables their clients to schedule appointments online. The plugin synchronizes the appointments with Body of Knowledge’s Google Calendar, and on the administrative side, provides invoicing and other bookkeeping capabilities.
  • Newport Homes for Sale – Terry Toppa, Broker Associate: you may recognize the last name 😉 . This is a site for my Dad’s real estate listings. It uses my Shashin plugin for the property photos and Deko Boko for the contact form. His friend Jim is a photographer, and he provided some fantastic pictures of Newport that really bring the site to life.
  • Boxing Dragons – Original Asian Art: I didn’t come up with the graphic designs on the other sites listed here, but I did for this one. I am by no means a graphic designer, but I can fake it sometimes. This site is over a year old now, and drove a lot of the improvements that went into Shashin 2.0 last year.
  • Kai’s Candy Company: this was my own business (why can’t I count myself as a client? 😉 ), which is now closed. I worked with a wonderful graphic designer, Paula Weindel, who created the site design for us. Our business volume never justified implementing a full-fledged shopping cart; Google Checkout served our needs just fine. After the business closed, I moved the site to free hosting with Google Page Creator.
  • The Hope Funds for Cancer Research: this project involved converting a static site to a dynamic one, and training their staff to use WordPress so they can manage most of the site without needing programming skills.

Post-to-Post Links II Now at WordPress.org

Post-to-Post Links II is a plugin for creating links to other posts, pages, tags, or categories on your WordPress site, and it’s now available for download at wordpress.org. I also created a documentation page.

There are a couple improvements with this version:

  • Now you can use it with tag slugs and tag IDs too
  • Fixed a bug with using category slugs

As explained in the readme file, it unfortunately can’t interpret the tags from Scott Reilly’s old “Easy Post-to-Post Links” plugin. I used his plugin heavily, and if you want to convert your old tags for use with my new plugin, you can. Doing so requires 1. you to be comfortable running a SQL query and 2. that you consistently used only post slugs or only IDs with Scott’s plugin. If you used IDs in some tags and slugs in others, then you can’t make the conversion (as there’s nothing in the syntax of Scott’s tag itself that indicates whether you’re linking by ID or slug).

These are the steps:

  1. Make a backup of your WordPress database, or at least the wp_posts table. This is very important, in case you make a mistake in the SQL.
  2. Run this SQL statement if you always used slugs for your links:
    update wp_posts set post_content = replace(post_content,'[post=','[p2p type="slug" value=');

    Or run this SQL statement if you always used IDs for your links:

    update wp_posts set post_content = replace(post_content,'[post=','[p2p type="id" value=');

I use the “text” attribute the same way Scott did, so that portion of the tag will carry over seamlessly in the conversion.

Koumpounophobia Now at WordPress.org

Koumpounophobia is a plugin for adding custom buttons to the WordPress HTML Editor, and it’s now available for download at wordpress.org. I also created a a documentation page.

I’ve made a few improvements with this version:

  • Now uses the jQuery plugin UI Dialog for controlling the modal input dialogs
  • Fixed bug with buttons for self closing tags that don’t use an input dialog (the button mistakenly tried to add a closing tag)
  • Simplified the HTML and CSS for the form input dialogs

If you made your own input dialogs based on the initial release, the HTML needed is now simpler. Please see the dialogs.html in the new version.

If you were using the initial release in conjunction with Post-to-Post Links II, you’ll want download a fresh copy of Post-to-Post Links II as well (not at wordpress.org yet, but it’ll be there soon now also at wordpress.org).

It still doesn’t work correctly in Internet Explorer 🙁 But I haven’t given up…