“If you can fly a Sopwith Camel, you can fly anything”

PHP Squad - two cheerleaders in a convertible wearing PHP tops… programmer’s equivalent.  6502 assembler.

Not that I could easily do that these days.  But it’s been a good thing to know, as I can debug most languages.  Except Erlang.  Some things ARE too strange to touch.

When I changed the blog theme to Thematic, the “Leave a comment” option disappeared.  Now, one of the tenets of the open source community is that you can fix your own bugs.  Not that many people do, as it often involves downloading/installing weird open source compilers, and growing a shovel beard.

Fortunately (?) as PHP is interpreted, I was able to find the offending bug with WinGrep.
And here it is:

// Display comments link and edit link
// comments open mean the blog post is accepting posts.
if (comments_open()) {
postcommentnumber = get_comments_number();
// postnumber is number of posts.  If more than 1, display “x comments”;
if (postcommentnumber > ‘1’) {(display “x comments”;)}
// if 1, display “comment”;
elseif (postcommentnumber == ‘1’) {(display “1 comment”;)}
// no comments, so display Leave a comment.
elseif (postcommentnumber == ‘0’) {(display “Leave a comment”;);

The bug?  postcommentnumber was returning “-1”.  I don’t know why, but I suspect it’s probably Disqus related.

And while I don’t particularly like PHP, I can debug it.
As the bug is fixed, you are welcome to “Leave a comment”.

Comments are closed.