$archives_dir = "./archives"; // do not change this. $cgi_ext = "cgi"; // open the entry .cgi file. $entry_file = file("$archives_dir/$padded_entry_number.$cgi_ext"); $number = count($entry_file); // reverse the entry file array and then remove the top 4 lines (which is the entry itself). if($number > 4) { $new_array = array_reverse($entry_file); $one = array_pop($new_array); $two = array_pop($new_array); $three = array_pop($new_array); $four = array_pop($new_array); // reverse the entry again to get the original order. $new_array = array_reverse($new_array); // put all the commenters into an array, take out commenters that didn't leave a url. foreach($new_array as $value) { $new_line = explode("|", $value); if($new_line[3] != "") $unique_array[] = "$new_line[0]|$new_line[3]"; } // count number of entries in the array $number_left = count($unique_array); if($number_left > 0) { // remove any duplicates. $unique_array = array_unique($unique_array); // you can comment the sorting out if you would like to have the list in the same order as people commented. sort($unique_array); // this goes before the list of commenters. echo "Commenters: "; foreach($unique_array as $value) { $lines = explode("|",$value); // this would be the line to change if you want it displayed differently (or if you wanted to add styles to it // for example, you can make the links part of a certain class... // echo "$lines[0] "; // use < and > to make the < > show up in the browser window. echo "$lines[0], "; } } } } ?>