묻고답하기

카운터에서...

2003.01.19 11:38

☺NaBi

http://secomhea.com/count/count.cgi
이 카운터에 보면 배경이 하얀색이잖아요
그래서 회색으루 바꿀려구 소스를 <body bgcolor="#F0F0F0"> 이걸 넣어야데는데
도대체 어딜 넣어야 될지 모르겠어요;
소스수정하는곳은 conut.cgi 밖에 없거든요
근데 그곳 어느곳에 넣어두 다 오류나더라구요
어딜 넣어야 될지;












<---conunt.cgi에 들어있는 내용 -->
#!/usr/bin/perl

$dir=".";
$total_count_file = "totalcount.dat";
$today_count_file = "todaycount.dat";
$yes_count_file = "yesdaycount.dat";
$max_count_file = "maxcount.dat";
$min_count_file = "mincount.dat";
$day_file = "today.dat";
$kdate = &get_date;

################## 수정해야 할 부분 ######################

$where="1";         # 카운터를 가로로 놓으려면 0, 세로로 놓으려면 1로

#_______________ 전체 오늘 현재 등의 글자색 설정 ________________

$total_textcolor="#808080";        # 전체 글자색
$today_textcolor="#808080";      # 오늘 글자색
$yes_textcolor="#808080";         # 어제 글자색
$max_textcolor="#808080";       # 최대 글자색
$min_textcolor="#808080";        # 최저 글자색
$user_textcolor="#808080";       # 현재 글자색


#______________ 전체 오늘 현재등의 숫자(데이타)색 설정 __________

$total_datacolor="#404840";         # 전체 데이타색
$today_datacolor="#404840";       # 오늘 데이타색
$yes_datacolor="#404840";         # 어제 데이타색
$max_datacolor="#404840";        # 최대 데이타색
$min_datacolor="#404840";         # 최저 데이타색
$user_datacolor="#404840";         # 현재접속자 데이타색

################### 여기까지 ##############################
&cookie;
&get_current;
&get_Total_num;
&get_date_file;
&get_max_num;
&get_min_num;
&get_yes_num;
&get_today_num;
&put_date_file;  
&print_count;


sub get_date {
  local ($current_date, $sec, $min, $hour, $day, $mon, $year);
  ($sec ,$min, $hour, $day, $mon, $year) = (localtime(time))[0,1,2,3,4,5];
  $mon++;
  $current_date = "$day";

($current_date);
}

sub get_date_file {
   open(COUNT,"$day_file") || die "Can't Open Count Data File: $!n";
    $day_file_count = <COUNT>;
   close(COUNT);
   if ($day_file_count =~ /n$/) {
      chop($day_file_count);
   }
}

sub put_date_file {
   open(COUNT,">$day_file") || die "Can't Open Count Data File For Writing: $!n";
   print COUNT "$kdate";
   close(COUNT);
}


sub get_Total_num {
   open(COUNT,"$total_count_file") || die "Can't Open Count Data File: $!n";
    $total_count = <COUNT>;
   close(COUNT);
   if ($total_count =~ /n$/) {
      chop($total_count);
   }
if ($COOKIE{'COUNT'} ne "카운터"){$total_count++;}
   open(COUNT,">$total_count_file") || die "Can't Open Count Data File For Writing: $!n";
   print COUNT "$total_count";
   close(COUNT);
}

sub get_yes_num {
   open(COUNT,"$yes_count_file") || die "Can't Open Count Data File: $!n";
    $yes_count = <COUNT>;
   close(COUNT);
   if ($yes_count =~ /n$/) {
       chop($yes_count);
   }
   }

sub get_max_num {
   open(COUNT,"$max_count_file") || die "Can't Open Count Data File: $!n";
     $max_count = <COUNT>;
     close(COUNT);
   if ($max_count =~ /n$/) {
     chop($max_count);
     }
     }

sub get_min_num {
   open(COUNT,"$min_count_file") || die "Can't Open Count Data File: $!n";
     $min_count = <COUNT>;
     close(COUNT);
   if ($min_count =~ /n$/) {
      chop($min_count);
     }
     }

sub get_today_num {
   open(COUNT,"$today_count_file") || die "Can't Open Count Data File: $!n";
    $today_count = <COUNT>;
   close(COUNT);
   if ($today_count =~ /n$/) {
      chop($today_count);
   }
   if ($kdate == $day_file_count){
if ($COOKIE{'COUNT'} ne "카운터"){$today_count++;}
   }
      else {
           $yes_count=$today_count;
            open(COUNT,">$yes_count_file") || die "Can't Open Count Data File For Writing: $!n";
            print COUNT "$yes_count";
            close(COUNT);
      if ($max_count < $today_count) {
          $max_count = $today_count;
          open(COUNT,">$max_count_file") || die "Can't Open Count Data File For Writing: $!n";
          print COUNT "$max_count";
          close(COUNT);
          }
          elsif ($min_count > $today_count) {
          $min_count = $today_count;
          open(COUNT,">$min_count_file") || die "Can't Open Count Data File For Writing: $!n";
          print COUNT "$min_count";
          close(COUNT);
          }
           $today_count=1;
   }
  

   open(COUNT,">$today_count_file") || die "Can't Open Count Data File For Writing: $!n";
   print COUNT "$today_count";
   close(COUNT);
}
sub get_current {
unless (open(MYDIR, "$dir/logs")){
print `mkdir $dir/logs`;
print `chmod 777 $dir/logs`;
print `chmod 777 $dir`;
}

$user_ip=$ENV{'REMOTE_ADDR'};

opendir(MODIFY_FILE, "$dir/logs");
@modify_file = readdir(MODIFY_FILE);
closedir(MODIFY_FILE);
foreach $modify_file (@modify_file) {
if (-f "$dir/logs/$modify_file") {
if (-M "$dir/logs/$modify_file" > 60/60/24) {
print `rm -rf $dir/logs/$modify_file`;
}
}
}

$login_data=join("||", "$year$mon$day$hour$min$sec");
unless (open(MYDIR, "$dir/logs/$user_ip")){
open(WRITE, "+>$dir/logs/$user_ip");
flock (WRITE, 8);
print WRITE "$login_datan";
close(WRITE);
flock (WRITE, 2);
print `chmod 777 $dir/logs/$user_ip`;
}

opendir(COUNT_FILE, "$dir/logs");
@count_file = readdir(COUNT_FILE);
closedir(COUNT_FILE);
foreach $count_file (@count_file) {
if (-f "$dir/logs/$count_file") {
$user_count++;
}
}#foreach문 종료
}
#------------------
sub print_count {
   print "Set-Cookie: COUNT=카운터;rn";
   print "Content-type: text/htmlnn";
   print "<html>n";
   print "<STYLE TYPE="text/css">";
   print "<!--";
   print "body, table, tr, td{";
   print "  color: black;";
   print "  font-family: 정9, verdana, arial, helvetica, sans-serif;";
   print "  font-size: 9pt;";
   print "  }";
   print " A:link    {text-decoration:none;}";
   print " A:visited {text-decoration:none;}";
   print " A:active  {color:red;}";
   print " A:hover  {color:red;}";
   print "-->";
   print "</style>";
   print "<body>n";
#_______________________________________ display1(세로배열)___________________________________
if($where eq "1") {
   print "<font color=$total_textcolor>전체</font> <font color=$total_datacolor>$total_count</font><br>n";
   print "<font color=$yes_textcolor>어제</font> <font color=$yes_datacolor>$yes_count</font><br>n";
   print "<font color=$max_textcolor>최고</font> <font color=$max_datacolor>$max_count</font><br>n";
   print "<font color=$today_textcolor>오늘</font> <font color=$today_datacolor>$today_count</font><br>n";
}
#_______________________________________ display2(가로배열)__________________________________

else {
  print "<font color=$total_textcolor>전체</font> <font color=$total_datacolor>$total_count</font> <font color=$yes_textcolor>어제</font> <font color=$yes_datacolor>$yes_count</font> <font color=$max_textcolor>최고</font> <font color=$max_datacolor>$max_count</font> <font color=$today_textcolor>오늘</font> <font color=$today_datacolor>$today_count</font>n";
}
#__________________________________________________________________________________________

   print "n</body></html>n";

   exit;
}


sub cookie{
    if($ENV{'HTTP_COOKIE'}) {
        @cookies = split(/; /,$ENV{'HTTP_COOKIE'});
        foreach(@cookies) {
        ($name,$value) = split(/=/,$_);
        $COOKIE{$name} = $value;
        }}
}
<--끝-->

코멘트 부탁드려요 (__)
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
야호미 PHP 대한 질문 입니다.. 답변좀 해주세요... [4] 2007.08.10
Huya 저기.. 포샵이나 여러가지로. [1] 2007.08.10
늘처음처럼 outlogin에 설치관련 질문입니다. 제 outlogin.php 예제소스인데 어디가 잘못된건지요. 잘 아시는분 답변 부탁 드려요. [4] 2007.08.10
이희덕 mysql 용량 제한시..  
김성목 이미지에 마우스 오버시 레이어가 뜨게하는 방법좀... [2] 2007.08.10
최민기 이 시스템이 어떻게 구축된건지 알고싶습니다. [6] 2007.08.10
권지은 자신의계정도메인/제로보드디렉토리 이게 뭡니까? [2] 2007.08.10
아나키 테이블 정렬이 잘 안먹혀요..(초보) [2] 2007.08.10
최민기 이 시스템이 어떻게 구축된건지 알고싶습니다. [3] 2007.08.10
정지윤 select count(*) from 어쩌고 할때 count(*)은 뭐죠? [5] 2007.08.10
딴따라 웹에 관련된 질문은 아닙니다.. ^^ [1] 2007.08.10
임승재 ftp에 관련된 질문입니다.. [3] 2007.08.10
Denma 질문은 아닙니다.. 무척이나 기분이 나뻐서 그렇습니다.. 어떻게 할까요? [2] 2007.08.10
피버노바 자바스크립트좀 도와주세요. 간단한것 [1] 2007.08.10
텔미썸띵 php와 mysql의 역할이 뭔가요? [2] 2007.08.10
Huya 질문입니다.~! [1] 2007.08.10
레드 자동으로 줄이 넘어가게.. [2] 2007.08.10
아핫핫 도메인 관련 질문입니다. [2] 2007.08.10
아핫핫 네임 서버 관련 [1] 2007.08.10
☺NaBi 카운터에서... [2] 2007.08.10
kunbi 팝다트와 비슷한........  
최봉수 이거 꼭좀 가르쳐주세요! 고수 님 ㅠㅠ [1] 2007.08.10
권영훈 포토샵 7.01 을 사용중인데요 _-_;; [3] 2007.08.10
레드 제 아이피로 들어가면요.. [9] 2007.08.10
정달용 정적 변수와 전역변수에 대한 질문;; [3] 2007.08.10
권민섭 백그라운드 에관한건데요... 투명처리를.... [1] 2007.08.10
클린아이 폰트 고수님 이것좀 봐주세요. [1] 2007.08.10
SJH 최근게시물...-_-;;; [2] 2007.08.10
제이 자바스크립트에 오류난것같은데~ [2] 2007.08.10
이효석 운영자님.. 제로보드 설치가 안되나봐여