function commentCount($n) { $comments_path = "http://www.kjbland.com/blog/comments/"; if($file = @fopen($comments_path . "comments/$n.comment", 'r')) { $thisFile = fread($file, '1000000'); $thisFile = explode("\n", trim($thisFile)); fclose($file); $comments = sizeof($thisFile); if($comments == 1) {$comments .= " comment";} else {$comments .= " comments";} } else { $comments = "0 comments"; } return $comments; } ?>