WordPress Plugin: Smart Unread Comments

As seen on Webfroot and this site, now in WordPress Plugin form!

Current Version: 1.3

What it does
Creates a list of posts with comments that haven’t been read by the user since their last visit/session. Uses cookies to track users last visit – no database required!

How it works:
Users are issued cookies which are used to track last visit. If this is their first visit, all comments in the last 14 days are unread. The plugin generates a list of unread comments. It keeps track of the user’s read posts for the session, removing them from the list as the user goes. Each page load updates the last unread timestamp cookie. Users can also mark all comments as read.
(more…)

Feed the Firefoxes!

On Saturday my friend Matthew and I trapsed down to Wellington Zoo and got to feed the Red Pandas. The chinese name for the red panda literally translates to “Firefox”, which co-incidently happens to be the name of our favorite web browser. Yes, we’re geeks and proud — get the heck over it! 😉

The Red Panda Encounter at Wellington Zoo cost us NZD$60 each, and was worth every cent 🙂 We spent what seemed like ages in the enclosure with the red pandas, along with the really helpful keeper who was telling us nearly everything there is to know about these cute critters. They’re an endangered species, and there is an international breeding program going on. What was really interesting was that the breeding program is administrated, and the decisions for which animals get to breed together is influenced heavily by DNA sampling and trying to keep genetic variance in the population… wow…

It was quite strange, as the first red panda that came up to us would come and eat some food, then climb back into the tree and then climb back down and eat some more. And it was eating the food right out of our hands!

Wellington Zoo has (I believe) five Red Pandas, all of which are extremely cute and cuddly. That said, we didn’t get to cuddle them 😉 Actually, towards the end, Matthew asked if we could pet them, and the keeper said sure, if they’ll let you. I tried, but they kinda shy away a little. They are quite timid and secretive creatures. Apparently they don’t have much of a personality, when compared to other mammals like cats, dogs or chimps.

Anyway, a stackload of photos were taken. Check them out, and feel free to leave comments 🙂

Re-learning to type

Hey Adam,

I heard on the show you were looking to learn how to type better. I used to be just like you, always looking at the keyboard, somewhere between hunt and peck and touchtyping.

A few years ago I had a whole lot of spare time on my hand, and I looked into the Dvorak keyboard layout. It’s a completely different keyboard layout, but it’s got some advantages over the standard QWERTY layout. All the vowels and most common constants are on the ‘home keys’, and more common letters are nearer the home row.

  ` 1 2 3 4 5 6 7 8 9 0 [ ] BACKSPACE
     ' , . p y f g c r l / =
     a o e u i d h t n s - ENTER
      ; q j k x b m w v z

You don’t need a new keyboard to learn Dvorak, because Windows, Linux and MacOSX have the ability to switch to Dvorak in software (instructions later).

Learning Dvorak appealed to me because I could learn keyboarding afresh — my bad habits that I had learned using the QWERTY layout would be useless.

It took me about 6 weeks of typing before I was able to ditch the Qwerty layout. But during that time, if I had something important to do, I would switch back to Qwerty, and when I was done switched back to Dvorak.

However, it has been said that you can learn the Dvorak layout in about a month…

About 2 months after starting the learning process, my friend started learning Dvorak too. We’re both computer programmers working in the Web industry, so typing is an integral part of our day. I now no longer look at the keys, and am touch typing. I average about 45wpm when typing from copy.

Biggest con with the Dvorak layout:
Ctrl-Z : Undo
Ctrl-X : Cut
Ctrl-C : Copy
Ctrl-V : Paste

Those editing key shortcuts are grouped together on the Qwerty keyboard, and are close to the Ctrl key — On Dvorak keyboards they are all over the place. And the worst one is when editing a blog post in a web browser, and on Dvorak you go to press Ctrl-V but by accident you press Ctrl-W, which is the shortcut for Close Window… that’s something that really got me angry when learning.

But four years on, I’m still a Dvorak advocate.

If you do want to learn keyboarding (Q or D) here’s a tip:
Don’t EVER look at the keyboard while learning.
If you’re learning Dvorak for one, your keyboard will have the wrong key labels on them. Instead of buying a new keyboard or putting labels on your keys, print out a copy of the layout and attach it to your monitor somehow. Typing tutor programs display the keyboard on the screen for a reason 🙂

A veritable treasure trove of Dvorak information is available at http://www.mwbrooks.com/dvorak/ including a picture of the layout and how get your OS to remap your standard QWERTY keyboard to a Dvorak layout

A really good typing tutor program is Ten Thumbs Typing Tutor, and is available for Windows, Linux and Mac!

Anyway, love the show, keep it real!

WP Plugin: Official Comments

I just whipped up a quick WordPress 1.2/1.5/2.0 plugin that allows you to distinguish comments made by WordPress users. It also will automatically approve comments made by WP users.

Current Version: 1.1

How It Works:
If you are logged into your WordPress admin panel, and you make a comment, the plugin will see that you are an official WP user of your blog and mark the comment with your WP User ID.
When the page is rendered, that User ID is called up by the plugin functions, which you can use to change text, change CSS class, add images, whatever your imagination desires.

Installation
Either:

  • RECOMMENDED: Install WordPress Plugin Manager then use the One Click Install for Official Comments. This will also make it easier to install other plugins and upgrade them in the future.
  • OR: Download Official Comments, extract and upload official-comments.php to your wp-content/plugins directory. Log-in to your WP admin panel, go to the Plugins tab and activate the Official Comments plugin.

How to implement:
Simply add this somewhere within the Comments loop in wp-comments.php and/or wp-comments-popup.php:

<?php if(is_wpuser_comment() != 0) {echo "Official ";} ?>

Or get tricky and add a CSS Class to the LI:

<li class="comment <?php echo (is_wpuser_comment() ? ' commentOfficialUser' : ''); ?>" id="comment-<?php comment_ID() ?>">

and this very basic css example:

.commentOfficialUser { border: 1px solid black; background-color: #999999 }

Documentation
View Official Comments Readme.txt

Examples
There is a very basic example on this post, but more exciting examples available at Webfroot.

Known Issues
It only works with official comments made after the point of installation, as WordPress doesn’t automatically add the WP user ids to the comments field it already has.

Bugs and Suggestions
Any bugs or suggestions, please email me — email link in the sidebar (RSS readers: drop by the site 😉 ).

Responsible Tourism

Launched a new website at work today — Responsible Tourism. It’s semantically correct, valid XHTML 1.0 Transitional, valid CSS, and looking good 🙂 I did all the design work for the site, except the logo — we got a contractor to do that. XHTML and CSS all by yours truly 🙂

I’m especially proud of the CSS work on “The Code” on the index page — it looks like a table, but it’s not! — it’s a <dl> with nested <ul>s! Mmm… semantic goodness 🙂

I used Fireworks, Dreamweaver, TopStyle and the content editors all used Contribute.