font = false; $this->error = false; $this->size = 25; if (is_numeric($filename) && is_numeric($path)) { $this->x = $filename; $this->y = $path; $this->type = "jpg"; $this->img = imagecreatetruecolor($this->x, $this->y); if (is_array($col)) { $colour = ImageColorAllocate($this->img, $col[0], $col[1], $col[2]); ImageFill($this->img, 0, 0, $colour); }}} function addText($str, $x, $y, $col) { $colour = ImageColorAllocate($this->img, $col[0], $col[1], $col[2]); Imagestring($this->img, 5, $x, $y, $str, $colour); } function outputImage() { header("Content-type: image/jpeg"); imagejpeg($this->img); } function getWidth() { return $this->x; } function getHeight() { return $this->y; } function getImageType() { return $this->type; } } $file="count.txt"; if ($c=fopen($file, "r+")) { $count=fgetss($c, 255); $count=ereg_replace("[^0-9]", "", $count); rewind($c); if (!is_numeric($count)) $count=0; $count++; fputs($c, $count); fclose($c); if (is_numeric($count)) { $x1=1; $y1=2; $h=20; $w=strlen($count)."0"; $bgcolor="0,0,0"; $bgca=explode(',', $bgcolor); $Counter=new Counter($w, $h, Array($bgca[0],$bgca[1],$bgca[2])); $txtcolor="255,255,255"; $txca=explode(',', $txtcolor); $Counter->addText($count, $x1, $y1, Array($txca[0],$txca[1],$txca[2])); $Counter->outputImage(); }} ?>