The day after making my new comments feature, I wake up to find a lot of comments posted. That's awesome, I feel loved.
Features to add:
- remember to stripslashes (I really hate magic quotes) (done)
- remember name, email, and website values in a cookie (done)... did you know that PHP does magic quotes on cookie values?! Pain in the butt. Very possibly PHP's worst thought out feature.
- get the comment count to work on my main weblog. Ha! Did it! MySQL doesn't support sub-selects, so it was a pain in the ass, but I got it.
- fix up the style a little
- use my markup parser, or at least nl2br and htmlspecialchars. (nl2br and htmlspecialchars done)
- Make some way to edit comments. This might be more trouble than it's worth, but it would be neat for anyone to be able to correct typos (I've already made some)
- be able to point to a specific comment. I can do it with an anchor link on the url, and I can also be cool and highlight that post a special color to make it more obvious. Update, turns out this can't be done with an anchor link, since that part of the url isn't even sent to the server. Boo.
- code an administration interface so that I can delete inappropriate comments.
- Make something available so that you can choose to be e-mailed whenever there is an update to a post you commented on, or when someone adds a comment. (Just like a real discussion board

Anything else? Feel free to leave suggestions. Hah!
Also, I just wanted to say thanks to Charles, whose comments feature I looked to as a starting point for my own. I still want to know how he gets a comment count with every post on his main page. MySQL is rejecting my SQL when I try to do it how I would with other RDBMS. If anyone can tell me how to do a count(*) along with a left join in MySQL, or any other way to do it without doing a separate query for each post, I'd appreciate it.
Update, just heard from Charles. I had sent him an e-mail last night asking him that question. Here's his response (hope he doesn't mind me quoting him): "Easy -- I don't do a database query at all! Our site uses flat files, no database. The number of comments is stored in a field in the entry's data file." lol, I never guessed.
Feel free to post a comment below. Please see my comment policy.
Formatting Rules (No HTML):