function commentCount($n) { // set the same values from comments.php $bannedIP = array("128.195.15.174","198.81.26.49"); $banIPMode = "1"; $comments_path = "/home/sygyzy/public_html/blogger/"; // Don't edit from this point if($file = @fopen($comments_path . "comments/$n.comment", 'r')) { $thisFile = fread($file, '1000000'); $thisFile = explode("\n", trim($thisFile)); fclose($file); $comments = sizeof($thisFile); if($banIPMode) for($i = 0; $i < sizeof($thisFile); $i++) { $thisComment = explode('[+]', $thisFile[$i]); if($thisComment[6] || $banIPMode != 4 && in_array($thisComment[5], $bannedIP)) $comments--; } if($comments == 1) {$comments .= " comment";} else {$comments .= " comments";} } else $comments = "0 comments"; return $comments; } ?>
|
|||||||||||||||||