function commentCount($n) { $n = substr_replace($n, '', 0, 1); //$comments_path = "http://www.notnothing.net/prinsiana/journal/"; $comments_path = "./"; if($file = @fopen($comments_path . "comments/$n.comment", 'r')) { //$thisFile = fread($file, '1000000'); $thisFile = ''; while (!feof($file)) { $thisFile .= fread($file, 8192); } $thisFile = explode("\n", trim($thisFile)); fclose($file); $comments = sizeof($thisFile); if($comments == 1) {$comments = "this is comment, one.";} else {$comments = "these are comments, " . $comments . ".";} } else { $comments = "these are comments, absent."; } return $comments; } ?>
|
|
|||||