$highvalue || $lowvalue > $count); } //----------------------------------------------------- // GetCounterTime($file) // - - - - - - - - - - - - - - - - - - - - // Returns the UNIX timestamp for when the counter file // was created. // // On error, returns "" or 0. //----------------------------------------------------- function GetCounterTime($file) { if( !($fp = fopen( $file, "r" )) ) { print "\nError reading counter file: $file.\n"; $count = 0; } else { $count = strtok(fgets($fp,80), " "); $time = strtok(" "); fclose($fp); } return $time; } //----------------------------------------------------- // InsertCounterDate($file,$offset,$format) // - - - - - - - - - - - - - - - - - - - - // Prints the date the counter was created. // // See: GetCounterTime() //----------------------------------------------------- function InsertCounterDate($file, $offset=0, $format="long") { $kHour = 60*60; $time = GetCounterTime($file); if( strcasecmp($format,"long") ) print date("l, F j, Y",$time+$offset*$kHour); else print date("m/d/y" ,$time+$offset*$kHour); } //----------------------------------------------------- // InsertCounterTime($file,$offset,$format) // - - - - - - - - - - - - - - - - - - - - // Prints the time of day the counter was created. // // See: GetCounterTime() //----------------------------------------------------- function InsertCounterTime($file, $offset=0, $format="long") { $kHour = 60*60; $time = GetCounterTime($file); if( strcasecmp($format,"long") ) print date("g:i:s A",$time+$offset*$kHour); else print date("g:i A" ,$time+$offset*$kHour); } ?>