2006년 2월 1일 수요일

카운터 프로그램 변경

나로그를 내리고 TraceWatch로 변경.



나로그의 기능이 부족한것은 절대 아니지만, 현재 tracewatch의 기능중 country_ip기능을 댓글에 사용중이므로 통합을 겸해서 변경.


이미지 카운터 프로그램 변경


기존 에 나로그의 카운터 내용을 보여주던것을 tracewatch의 카운터 내용을 보여줄수 있도록 삽질..완료.



<?

mysql_connect("localhost","*******","********");  // 3.호스트이름, 아이디, 암호

mysql_select_db("*********"); // 4.디비이름


// 나로그사용시작..

//$blog_id="blog";

//$yy=date(Y);

//$mm=date(m);

//$dd=date(d);

//$count=mysql_fetch_array(mysql_query("select total from nalog3_config_$blog_id"));  //

//$total_count=$count[total];


//$query="select * from nalog3_data where counter='$blog_id' and yy=$yy and mm=$mm and dd=$dd";

//$counter_today=mysql_fetch_array(mysql_query($query));

//$today_count=$counter_today[hit];

// 나로그 사용 끝.




//tracewatch 시작

$initial_start=8706; // 초기시작값.

$temp=mysql_fetch_array(mysql_query("select sum(count) from twatch_hits"));  //

$total_count=$temp[0]+$initial_start;


$trace_today=date("Y-m-d");                         

$temp=mysql_fetch_array(mysql_query("select count from twatch_hits where dt='$trace_today'"));  //

$today_count=$temp[count];

//tracewatch 끝.


header("Content-type:  image/png");


// 바이오 리듬 실행 파일의 config 파일

$bio_x_max_size=80;  //가로 사이즈

$bio_y_max_size=15;  //세로 사이즈


// $image_count = imageCreate($bio_x_max_size, $bio_y_max_size); // 그림판을 만든다.

$image_count=imageCreateFromPNG("zs_count.png");

$colorBackgr       = imageColorAllocate($image_count, 255,255,255); // 배경 

$colorForegr       = imageColorAllocate($image_count, 95, 95, 95); // 테두리


 $colorGrid         = imageColorAllocate($image_count, 172, 172, 172);

 $colorCross        = imageColorAllocate($image_count, 4, 63, 185);


 $color_data_font =  imageColorAllocate($image_count, 255, 255, 255); // 글에 사용하는 폰트


 

  imagestring($image_count,1, 40,3,"$today_count/$total_count", $color_data_font);

 imageInterlace($image_count, 0);

// imageColorTransparent($image_count, $colorBackgr);


// imageGIF($image_count,$img_file);

//  ImageJpeg($image);

ImagePng($image_count);

// ImageDestory($image_count);

// echo "<img src=bio.png>";

?>


댓글 없음:

댓글 쓰기