Matt Martz has put up a very cool tutorial on segregating comments from trackbacks with WordPress 2.7 (something that has always been on my todo list, actually). Another handy read for theme authors.

Related posts

WordPress 2.7 (release date: November 2008) will bring a load of new features, and most of the cool new bits will concern comment managements. On the public side of your blog, you will be able to show them threaded and paged without any extra plugin. Well, at least if your theme is able to do so.

Otto has written a very nice article explaining how to get a theme ready for 2.7 and the comment stuff. It’s clean, detailed and goes step by step through all the new things. A must read for theme authors.

Related posts

In: On: 2008 / 09 / 08

Two hours ago WordPress 2.6.2 was committed. It’s yet to be announced on the Development Blog but anyway, this is a very urgent mandatory upgrade. Let’s all salute the responsiveness of the core team: version 2.6.2 was released about 5 hours after a critical bug affecting 2.6.1 was filed.

Upgrade!

Related posts

In: , , On: 2008 / 09 / 07

I ran into an interesting problem, facing what is certainly an HTML limitation that had somehow never really occurred to me. The thing is: when you submit a form with empty fields, empty values are POSTed, except for checkboxes and radio buttons which are not posted at all, just as if they were no such field in the form.

For instance, this form:

HTML:
  1. <form method="post" action="">
  2. <input type="text" name="input" value="">
  3. <input type="hidden" name="hidden" value="">
  4. <input type="checkbox" name="checkbox">
  5. </form>

Submitting it, leaving empty values and not checking the checkbox, you would get the following $_POST array (notice the missing "checkbox")

PHP:
  1. array (
  2.   "input" => "",
  3.   "hidden" => ""
  4. )

In short: <input type="checkbox" name="field" value="something"> either gets submitted as field = "something" if checked, or doesn't exist if unchecked.

My problem was that I needed to process an arbitrary number of checkboxes while being able to know wether a checkbox was left unchecked, that is I needed to have a value for each checkbox in the $_POST array, either blank/off/empty or checked/on/whatever.

The solution I found was simple: before each checkbox, add a hidden field with the same name:

HTML:
  1. <form method="post" action="">
  2. <input type="hidden" name="checkbox" value="">
  3. <input type="checkbox" name="checkbox">
  4. </form>

This way, there is always a value for field checkbox in the $_POST array: either "" if the checkbox was unchecked, or "on" if it was checked. I've uploaded a simple HTML form if you're curious to try: regular way, without the "special hidden" fields, or without the duplicate hidden fields. Submit the form with all fields left to empty and see the resulting $_POST array.

This simple yet effective and smart workaround was found by Cameron and I really love it. (And the image above is by Joey Rozier from a restaurant where you apparently can build your perfect burger, seems fun:)

This trick might or might now suit your need: for instance, client-side javascript serialization of the form could lead to something unexpected because of the duplicated fields. Also, this won't work with arrays of checkboxes (something like having multiple <input type="checkbox" name="field[]"/>). But for the particular case I had to deal with, it was very perfect. Love it.

Related posts

A post that's not about WordPress but, hey, it's about Jazz, so I'm not that far :)

One of my sisters works for the (French) National Jazz Orchestra and so I was invited to one of their concerts, featuring their album named Close to Heaven: A Led Zeppelin Tribute. Oh my. I know nothing about Jazz and I'm only a moderate fan of Led Zeppelin, but this was an absolutely stunning and delighting experience.

Read a review of this album on All About Jazz. Listen to these (two very short) samples. Then buy the album! It's ethereal.

Related posts

If anyone is interested, I have invites for Jaiku, Google’s Twitter service. Leave a comment with your email. (21) «

The WordPress Theme Toolkit is a tool that allows theme authors add an admin menu as easily as editing 3 lines, and it powers dozens of WordPress theme back ends.

Although everything still works fine and will probably work with all future versions of WordPress, I did not update its code in a while and, guess what, my coding skills are much better than two years ago, so there has to be things I can improve. I will soon give a stab at updating it, so I thought it might be a good idea to get feedback and possible feature requests.

If you're a theme author who has used or is using the Toolkit, what would you like to be added or changed? What would make your life easier and your authoring faster? If you're a theme user who is running a Theme Toolkit powered theme (ie there's a file named themetoolkit.php in your theme directory) and you know your theme author has a blog, feel free to contact them and point them here.

Related posts

jQuery docs in .CHM format (compiled HTML). Comes in handy especially given how often I cannot reach docs.jquery.com. Why didn’t I search for such a tool way earlier?… (1) «

To those using comment moderation on their blog, here is a simple trick that should become part of every theme.

I just left a comment on Logo Design Love, an empyreal blog about logo design by David Airey. My comment went into moderation as per his comment policy, but instead of the standard message you've been told a million times (the brutal "Your comment is awaiting moderation" which reads like a cold statement from a Custom officer), here is what I got:

See? Nothing genius, just less robotic attitude, just basic courtesy and a bit of information. But it definitely makes things more enjoyable. Will remember this whenever I code a theme.

Related posts

As you may have read it already on Lorelle's blushful announcement, I made a Comment Counter widget for Liz Strauss.

Liz Strauss is considered to be an expert in the art of engaging conversations and, for blog, comments (I dig her blog tagline "You're only a stranger once"). One day Lorelle and Liz were chatting about how successful she was on that field, and the idea of a wickedly cool widget that would show comment counts popped out.

It's been an exciting opportunity to "work" with these two fine ladies, and I'm very pleased by the result. The widget I made is pretty cool and flexible, with a lot of options. Think "feedburner badge", except you have everything under control.

The whole purpose of displaying your comment count is really up to you. The obvious usage would be showing off how social a website is, with a humongous five or six figure digit, but I think even for more humble sites with a few thousands, or hundreds, or even dozens, it has its role: it shows you simply care about comments and commenter, which is engaging for visitors and an invitation to join the discussion.

And anyway, it's just yet another fun chicklet :) Get yours!

Related posts

Close
E-mail It