KBD

Keith Devens .com

Friday, July 4, 2008 Flag waving
Don't panic. – Douglas Adams (The Hitchhiker's Guide to the Galaxy)
← Entry 1560Entry 1562 →

Daily link icon Tuesday, March 5, 2002

Entry 1561

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 Smiley

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.

← Entry 1560Entry 1562 →

Comments XML gif


Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 5 posts

Recent comments XML

Girls, please don't get breast implants

> And no, you will not be receiving​a picture.

:-(...

Keith: Jul 2, 6:05am

Javascript clone function

This is a clever way to clone an​object if you are using YAHOO UI.​Same tec...

Antonio: Jul 1, 12:47pm

I hate Norton Antivirus

Oh just one other thing norton is​great at keeping people out of your​compu...

kevin.sands: Jul 1, 12:50am

Terminator 3 was awful

I think the biggest reason why T3​totally blew was because Edward​Furlong g...

76.167.172.64: Jun 29, 3:06am

Generated in about 0.119s.

(Used 8 db queries)

mobile phone