Monthly Archive for February, 2007

Are your Wordpress comment counts right?

There was a user in the #wordpress IRC channel who was having some problems with his database’s comment_count field being incorrectly updated when deleting comments.

Since there were several of us who weren’t sure if their comment_counts had been properly updated when the field was added, I whipped up a series of SQL queries. There was a good bit of playing around, but the final version is:


SELECT id, comment_count
FROM wp_posts p
WHERE p.comment_count >0
AND (
id, comment_count
) NOT
IN (
SELECT comment_post_id, count( * )
FROM wp_comments c
WHERE comment_approved = '1'
GROUP BY comment_post_id
)

Of course update wp_ with whatever your database prefix is, assuming you didn’t use the default.

Updating these values should be about as simple, although I have not tested this:


update wp_posts p
set p.comment_count = (
select count(*) from wp_comments where comment_post_id = p.id and comment_approved = '1'
)

It’s a Non-RIAA Kind of Thing…

While Gizmodo is advocating that we “Put Our Money Where Our Mouths Are” and boycott the RIAA in March (an idea I fully support, and which Digg users obviously love), I was shocked at the number of popular records published by RIAA members.

I knew they were powerful, but I had no idea it was this bad.

Check out the RIAA Radar’s Amazon Top Albums list. How many green “Safe” tags do you see on that page? Far too few…

I was looking at The Killers’ Sam’s Town album, and decided to see what RIAA Radar recommended as RIAA-safe alternatives to The Killers. Much to my surprise, there are a number of excellent bands available through non-RIAA labels: Gnarls Barkley, The Postal Service, Snow Patrol, Death Cab for Cutie, Barenaked Ladies, Damien Rice, Gym Class Heroes, Arctic Monkeys, Panic! At The Disco, Buckcherry, Solomon Burke, The Shins - all quite popular non-RIAA label alternatives.

With all these popular “safe” alternatives, why wouldn’t you want to boycott the RIAA for a month? It’s not like you have to do without decent music for the month… Use the month of March as not only a month to show the RIAA you’re angry at them, but also as a month to find some new non-RIAA music that’s just as good and support some of the smaller non-RIAA labels and groups while you’re at it.

Stunt RIAA sales and show labels that they don’t need to join the RIAA to make money at the same time, all while enjoying some excellent music. What’s not to love?

Need some help staying RIAA-safe in March? Check out the RIAA Radar’s bookmarklets, just to make sure you don’t stray from the path while shopping. And while you’re finding great non-RIAA music, be sure to let others know about it by blogging about your favorite artists and commenting on Digg, Gizmodo, and other stories about the boycott. While you’re at it, drop a quick comment here about an artist you’ve found that you like on a RIAA-free label - I’m always looking for more music!

Now get out there and do it!

Update: For more quality RIAA-related babble from me, check out my previous blog entry: Oh No, Could the RIAA actually be Wrong?!

It’s Moto Q Time, Baby!

I’ve been trying to convince myself not to buy a Motorola Q for quite some time now1, but it looks like it may finally be time for me to give in and buy one. Now, just a few more months to wait…

  1. Pretty much since Verizon rolled out their EVDO service in the Greenville, SC area. [back]

TechEd - Or How I’d Rather Buy an iPhone

After ordering a TechNet subscription last week, now that Microsoft offers a significantly cheaper “Direct” (ie: download-only) version, I got a postcard in the mail today offering me a whopping $200 off an early-bird registration to Microsoft’s TechEd 2007 conference.

Just out of curiosity, I thought I’d check the TechEd site and see how expensive this particular conference was. I’m constantly amazed at how expensive some conferences can be, while the particularly interesting ones like WordCamp are 100% free.

In case you were wondering, the regular price for TechEd ‘07 is $1,9951, but if you register before AprilĂ‚ 7th, you can save a whopping $200 and get it for the rock-bottom price of $1,795.

I had thought about doing a little “What you could get instead of going to TechEd” segment, but turns out I’m too lazy. Suffice it to say: a lot2.

Now if only I could convince my boss to blow about $3,000 (including travel, meals, etc.) to send me to Orlando for 4 days…

  1. Can’t we just round up to $2,000 already? It’s $5 lousy bucks… [back]
  2. Like an Apple iPhone and about a year of unlimited data service from Cingular [back]

Wordpress Co-Op Search for Documentation

Anyone who’s ever tried it knows that the search functionality on the Wordpress Codex sucks horribly. In #wordpress, we have a bot that utilizes the Google site: query attribute to search Google’s listings for the codex, but sometimes you want to be able to search from your own web browser, not by going through an IRC bot.

Since typing in site:codex.wordpress.org gets boring fast, I decided to throw together a quick Google Co-Op search engine a while back that utilizes the Google index of the Codex, as well as a handful of other sites I’ve found with helpful Wordpress-related documentation (like the API Hooks list).

So if you’re interested, check out the Wordpress Documentation Search, powered by Google Co-Op.

If you’re a fellow Wordpress-lover and know of any good sites that should be included in the documentation, please feel free to volunteer! Remember that Google Co-Op will let you specify full sites, url patterns, or even specific individual pages, so even if you find a random blog entry that contains information you’ve found helpful, please add it to the list. If you don’t feel like volunteering directly, you can also just tack a comment on here about your favorite source for Wordpress documentation and hackery and I’ll add them to the list.

Here’s to better searching and learning through Google tools!