time() - 3) { //cant log yet - too early } else { $_SESSION['last_log'] = time() ; $section_content[3] = $hits ; $section_content[4] = time() ; $handle = fopen('data/' . $account . '.jac', w) ; for($a = 0; $a < 11; $a ++) { $write_data .= $section_content[$a] . '|' ; } fwrite($handle, $write_data) ; fclose($handle) ; } if(file_exists("images/counter/$section_content[1].png")) { $img_handle = ImageCreateFromPng("images/counter/$section_content[1].png") ; } else { $img_handle = ImageCreateFromPng("images/counter/default.png") ; } $txt_color = imagecolorallocate ($img_handle, 0, 0, 0) ; if(strlen($hits) < 2) { $hits = '000' . $hits ; } elseif(strlen($hits) < 3) { $hits = '00' . $hits ; } elseif(strlen($hits) < 4) { $hits = '0' . $hits ; } $center = 45 - ((strlen($hits) * 9) / 2) ; header("Content-type: image/jpeg") ; $font = imageloadfont($load_font) ; Imagestring($img_handle, $font, $center, 2, $hits, $text_color) ; imagepng($img_handle); } else { $img_handle = ImageCreateFromPng("images/counter/default.png") ; $txt_color = imagecolorallocate ($img_handle, 0, 0, 0) ; $text = "- - - - -" ; $center = 45 - ((strlen($text) * 9) / 2) ; header("Content-type: image/jpeg") ; $font = imageloadfont($load_font) ; Imagestring($img_handle, $font, $center, 2, $text, $text_color); imagepng($img_handle); } ?>