Arcanius Style Recent Comments

Album Cover: Crash

"You wear nothing, but you wear it so well."
Dave Matthews Band / Crash Into Me

Posted on December 09, 2005 12:52 AM in Web Development
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

I would have called them "Bernzilla Comments," but apparently the name was already taken. If you aren't reading this in a newsreader, you might have noticed that I've updated the way recent comments are displayed in the subheader of my site. The inspiration came, appropriately enough, from a recent comment by Ryan (aka Arcanius). We seem to have inspired each other, albeit in slightly different ways, so I think everyone wins in the long run.

Because of MySQL limitations like the one Ryan discussed and others, adding the new functionality wasn't as easy as it probably should have been. Going down the whole SELECT DISTINCT path didn't do much good either. MySQL does some funky things when you use DISTINCT in table joins or when returning several pieces of data. That is another subject for another time, though.

If anyone's particularly interested in how I implemented this, I might be willing to go into more detail. Because my blog is "home brewed" and I don't use a publicly available system like WordPress, the specifics of my code might not be as useful as posting pseudo code, but I'm willing to do either. In the meantime I'll just say that I wrote a custom PHP function to do the job.

I'm still debating whether I should report a count (in parentheses) when there has been only one recent comment for a post, or whether I should include the x as suggested by Ryan. I'd love to hear any and all feedback, so either leave a comment or send me an email.

Comments

Ryan on December 11, 2005 at 7:08 AM:

I notice that clicking on the recent comment link takes me to the last of the (x) comments, whereas I would expect it to take me to the first of the (x) comments.

Otherwise, I would be interested in the pseudocode at least, to see how much you relied on SQL and how much was processes in PHP afterwards, and how you did that, exactly.

Permalink

Ryan on December 11, 2005 at 7:08 AM:

Other than that one nitpick, it looks great and I think adds much to the usability of the site!

Permalink

Ryan on January 23, 2006 at 10:01 PM:

With how popular your site has become as of late, you may need to have more than three (3) recent comments up there! I came back to check and in just a few hours I've noticed that the entire list of comments that had been up before had scrolled off. Of course I'm probabally not helping, as this is my third comment (I think) tonight.

Permalink

Bernie Zimmermann on January 24, 2006 at 12:26 AM:

Or perhaps it's time for a Recent Comments feed. Hmm...

Permalink

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.