5 ) && ( $_REQUEST['all'] != 'all' ) ){ break; } # need to tag the directory with a / $travdir = $dir . $newsdir . "/"; if ( $df = opendir( $travdir )) { # inner while loop that fgets from news file while ( $file = readdir($df)) { # if the filename is news we have a news file if ( ereg ( '^news$', $file ) ){ if (! $newsF = fopen( $travdir . $file, "r")) { echo "Error processing news. Please contact system administrator."; } else { flock($newsF, LOCK_EX); print "\n"; } else { print "Error opening news directory... but it was just here a second ago... I checked."; } } closedir($dh); # short little form to allow user to show all news print ''; } else { echo "

No news is good news.

"; } ?>
"; # print contents of news file while ( !feof ( $newsF ) ) { print fgets( $newsF ); } flock($newsF, LOCK_UN); fclose ( $newsF ); } # the other possibility is a comment file... we will count these just to be cool } elseif ( ereg ( '^comment[0-9]+', $file ) ){ $comments[] = $travdir . $file; } } closedir($df); print "
Comments: " . count($comments) . "

'; print ''; print ''; print '