############################ # # tools.inc - basic tools # ############################ # counter function Counter() { //checks for file, if not then make function CountHits() { if (!file_exists("hit.log")) { $hitlog = fopen("hit.log", "a+"); fwrite($hitlog, "0"); fclose($hitlog); } //reads filesize $hitlog = fopen("hit.log", "a+"); $contents = fread($hitlog, 4096); fclose($hitlog); $cnt = bcadd($contents,1); unlink("hit.log"); //writes the hit $hitlog = fopen("hit.log", "a+"); fwrite($hitlog, $cnt); fclose($hitlog); return $cnt; } $hits = CountHits(); echo "$hits"; } # last updated function lastup() { $fmt2=date("F j Y h:i:s A",filemtime(__FILE__)); echo "$fmt2"; } ?>