i have made some changes to the original code but as of it is right here it works on mi local webserver (apache+php4.4.0 in windows)
<?php
//counter.php > Source
################################################
# SIXAL - ImageCounter v1.0 build 03/11/2005
#
info@6al.net
################################################
# ONLINE SAMPLE PREVIEW :
#
http://www.6al.net/
################################################
# Do not Edit
################################################
$count = $_GET['count'];
include("counter_config.php");
$des = imagecreate($counter_width,$counter_font_size);
$bgcol = HEX2RGB($counter_background);
$tcol = HEX2RGB($counter_color);
$bg = imagecolorallocate($des,$bgcol[0],$bgcol[1],$bgcol[2]);
$fc = imagecolorallocate($des,$tcol[0],$tcol[1],$tcol[2]);
imagecolortransparent($des,$bg);
$font = "../fonts/$counter_font.ttf";
$tt = $counter_numbers - strlen($count)-1;
$ts = 0;
while($ts <= $tt)
{
$count = '0'.$count;
$ts++;
}
imagettftext($des, $counter_font_size, 0, 0, $counter_font_size, $fc, $font, $count);
header("Content-type: image/gif");
imagegif($des);
function HEX2RGB($color){
$color = str_replace("#","",$color);
$color_array = array();
$hex_color = strtoupper($color);
for($i = 0; $i < 6; $i++){
$hex = substr($hex_color,$i,1);
switch($hex){
case "A": $num = 10; break;
case "B": $num = 11; break;
case "C": $num = 12; break;
case "D": $num = 13; break;
case "E": $num = 14; break;
case "F": $num = 15; break;
default: $num = $hex; break;
}
array_push($color_array,$num);
}
$R = (($color_array[0] * 16) + $color_array[1]);
$G = (($color_array[2] * 16) + $color_array[3]);
$B = (($color_array[4] * 16) + $color_array[5]);
return array($R,$G,$B);
unset($color_array,$hex,$R,$G,$B);
}
?>
i called like this to se if it works:
http://www.cet-utn.com.ar/imagenes/counter.php?count=123
and i get a:
Fatal error: Call to undefined function: imagettftext() in
/home/cetutnx1/public_html/imagenes/counter.php on line
32