How to highlight author comments in WordPress

A while ago I was looking around for how to make my own comments a different color on my blog. Most of the advice was along the lines of “Add code to check if the commenter’s email is the same as the email address of the blog’s author.” Can you spot the flaw in that logic? If a commenter knows the email address of the blog author, she could use the blog owner’s email address in her comment and get her own comment highlighted. Worse yet, someone could try to discover the blog owner’s email address by trying lots of email addresses until they saw their comments change to a different color.

So I dug a little deeper and found a good answer on this support thread. The trick is simple: instead of checking the author’s email address, check their user id to see if it’s the user id of the blog owner. Pretty smart. After that, it was a simple matter of

1. Changing my theme to add an “authcomment” style

I edited style.css and near the bottom added these lines:

.authcomment {
background-color: #B3FFCC !important;
}

2. Editing my comments.php file to add a little code

My comments.php file had a line that looked like this:

<li class=”<?php echo $oddcomment; ?>” id=”comment…

and I changed it to more or less look like this:

<li class=”<?php
/* Only use the authcomment class from style.css if the user_id is 1 (admin) */
if (1 == $comment->user_id)
$oddcomment = “authcomment”;
echo $oddcomment;
?>” id=”comment…

That’s about it. Now I have a distinctive color for my own comments, so you can quickly scan a thread to see when I circle back around to leave a comment.

11 Power Tips for Gmail

Update: Here’s one more bonus tip. Use the ‘m’ key to mute a conversation. Suppose you’re on a mailing list and you don’t care about what’s being discussed. The ‘m’ key will mute/murder that entire thread so that you never see that email or any follow-ups. The only way you’ll see the conversation again is if someone adds you to the “To:” or “Cc:” line of an email in the conversation. Read more if you’re interested.

Wow, I can’t believe how many people commented on my late-Friday night post about desired features for Gmail. If you want to suggest something for Gmail, that thread is the better place to do it. But looking through the comments, I saw a few requests that can already be done today. Considering that real Gmail users didn’t know about these options, I’m going to call them power tips.

Stylized Gmail logo

  1. Wayne Schulz said “I want to be able to paste images into the email.” Wayne, it’s not quite the same as pasting images into emails, but one thing that makes image attachments easier is the dragdropupload Firefox extension. You know how you can click “Attach a file” and then you’ll see the familiar “enter a file location or Browse..” form appear? With dragdropupload, you can drag any file (e.g. from your Desktop) and drop it in that text box. It’s a fantastic extension that makes it much faster to include attachments or upload files, and I use it all the time.
  2. Jason Bartholme asked about “A sort that would allow for my unread messages to be at the top.” Jason, trying doing a search for label:unread label:inbox . That should show only unread messages that are currently in your inbox. By the way, did you like how I shared a search with you? That was a tip from the Gmail blog. There are other cool labels you can use as well.
  3. Julian says

    I would like to have a feature for inserting prepared text blocks, so I dont have to write some things over and over again.

    Julian, if you use Firefox, check out the Signature firefox extension to insert text macros. That might work for you.

  4. Daniel asked

    Crazy feature: I’d like to be able to have an easy way to migrate my entire Google account to a different gmail address, because I can’t find a step-by-step guide or anything to help me switch emails without losing various things.

    According to this post you can enable POP on your old account (look under Settings, then “Forwarding and POP/IMAP”), then import the emails (also using POP) into the new account. I think you could use Gmail’s Mail Fetcher utility to do this. To configure Mail Fetcher on the newer account, click on Gmail’s Settings link, then “Accounts” and then “Add another mail account.” Google Operating System (an unofficial blog that discusses Google often) has a couple relevant posts with a walkthough of using Gmail’s Mail Fetcher and a write-up on how to back up your Google account.

  5. Sankarananad asked a related question:

    I would love to integrate my google apps account with my default gmail account. Although right now google allows to associate email address there is no way to integrate or link two google accounts (say one @gmail.com and another yourdomain.com powered by google apps).

    Right now the only solution is to forward mails from one box to another! If google makes integration possible we can use a single inbox to check mails from all those email address

    I’m not as familiar with the interaction of regular Gmail versus Gmail on Google Apps. This post described a scary-looking way that might work. If there’s a better way, maybe someone will stop by and let me know?

  6. Search Engines Web asked:

    The ability to open Word, Excel, PowerPoint and PDF without going to another page and using another software

    S.E.W, this post from Lifehacker mentions that Gmail can offer HTML view or Google Doc options for Word and Excel.

  7. Easton Ellsworth mentioned

    I’d love to be able to resize the email composition box on the default page – so instead of having to click the icon to open the whole draft in a new resizable window, I’d be able to click and drag to make the draft box bigger (especially vertically).

    Easton, check out the Resizeable text area extension for Firefox. It lets you click on the border of any form textarea and drag the border so the textarea expands. I haven’t checked how it works on the latest version of Gmail though.

  8. 1001 noisy cameras said “I think the ability to open emails in new windows would be great – it would help those users who are always multi-tasking.” If you’re looking at an email look at the top-right of the page and click on “New window” to open that email in a separate email.
  9. Diego asked

    I don’t know if this would be possible, but how about, when clicking on the compose link (or reply etc) if I hold some key as I click on Compose, it opens the new email in its own window? Same thing could go for Replies etc.

    Diego, instead of using ‘c’ to compose a new email, type ‘C’ and you’ll open a new window to compose your email. It looks like using ‘R’ instead of ‘r’ to reply will open a new email for replies too.

  10. jonathon asked “Is it me or does the pop3 server sometimes stop working when downloading email from gmail?” I’ve been using getmail to back up my Gmail, and I’ve noticed that Google will only let you download a few hundred emails in one batch. If you fetch again, you’ll often catch up. So usually it’s just a matter of being patient.

I heard a lot of great suggestions that I wouldn’t even have thought of. For example, I liked the idea of a “bounce” option for unwanted emails to make it look as if your email address didn’t exist. Oh, and since so many people asked for cool features, let me add one more feature I want: let me set a different vacation message for co-workers compared to people outside Google. Maybe in Google Apps for Gmail, if you are managing example.com, let people on example.com set a different vacation message for people on example.com vs. other domains?

By the way, what was the funniest suggestion I saw? Jeff Hall won with “A USB breathalyzer kit for a friend who forgets how embarrassing her e-mails are when she gets drunk. The e-mails could be delayed until she provides a negative sample.” :)

And here’s your bonus tip. If you’re a Gmail power user, three links to check out are the Gmail tag on Lifehacker, the official Gmail blog, and Google Operating System. Lifehacker does so many posts per day that limiting to the Gmail tag will narrow down the posts you see. The Gmail blog is the best place to get official Gmail news first. And Google OS seems to have Gmail-related posts pretty often.

What Gmail feature do you want the most?

I really like Gmail because it makes email much less annoying. But I’ve been thinking about a feature that I really want in Gmail: I want the ability to delay sending replies/emails until a certain time or date. As a computer science person, here’s how I’d turn that one feature into three features:

  • The “Oops” filter. Have you ever hit send on an email at the exact same time that you noticed a typo? Or did you ever get “emailer’s regret” because you sent a snarky or angry email instead of polite one? The “oops” filter would let you delay sending email for a short while (two minutes if you suffer from typo-itis, longer if you tend to flame in emails) until you’re sure you want to send that email.
  • Slow down a conversation. If you’re like me, you treat your inbox as a to-do list. And if I can deal with an email in a minute or two, I often do. Then the other person writes back quickly. Then I write back quickly. Before you know it, you’ve traded several emails that you didn’t need to. If someone emails me a non-critical email, sometimes it would be nice to write a reply immediately, but set the email to wait for a few hours before heading to the other person.
  • Periodic events. If I know that I’m going to need to collect data from someone at the end of the week or quarter, why can’t I write the email now and set it to ping them when the time is up? If someone says “this bug will be fixed in three weeks,” it would be great to write a “Hey, how’s that bug going?” email and set it to tickle or ping them in three weeks.

Part of me wonders whether the Greasemonkey API for Gmail could do something like this, maybe by storing the date to send an email as some sort of special tag. Part of me wonders whether someone has already created something like this for Gmail.

And part of me wonders: what feature would you like to see in Gmail? Now that Gmail has free POP, IMAP, and an iPhone version, what do you want to see next from Gmail?

What should I do with my draft posts?

Over the last 2+ years, I’ve written a lot of draft blog posts that I never published. Most of them are pretty sucky/rough, but not all of them. At this point, I’ve published ~584 posts and I’ve got about ~219 draft posts. After WordPress had a recent security hole that could expose draft posts, I’m planning on clearing out most of my draft posts. The question is: should I delete them all, or should I push some of them live, even though they’re mostly low-quality?

Anyone have strong opinions either way? Should I unload some of these leftover posts onto my blog, or try to keep my blog mostly higher-quality and just delete all those old/junky drafts?

What’s the best NAS right now?

As I mentioned earlier, my current network-attached storage (NAS) box took a hit in a power outage. This is what it looked like after I took it apart to swap in a new hard drive.

Buffalo Tech Terastation

So I’m looking for a new NAS. Price isn’t really a concern at all, but here’s stuff that I require:

  • Ability to hot-swap drives. My current NAS requires 22 screws (!) to replace a hard drive.
  • Gigabit ethernet
  • Anything can reach it (Linux/Mac/Windows)
  • Lots of drive bays (four at least)
  • Quiet and fast

Some stuff that would be nice:

  • Ability to accept hard drives of different sizes
  • Ability to work with a uninterruptible power supply (UPS)
  • Ability to email if there are issues
  • Lots of server potential (Sonos, Squeezebox, iTunes, DLNA, FTP server, printserver)
  • Ability to run linux or otherwise ssh in

Do you have a NAS that you’d recommend?

css.php