#! /usr/local/bin/perl require 'jcode.pl'; $cginame = "non"; $sub_file = $cginame.".sub"; $log_file = $cginame."_log"; $cgi_file = $cginame.'_i.cgi'; $log_file_i = $cginame."_log_i";#i-mode用ログファイル $title = "のんチャット"; $log = "30"; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); if ($sec < 10) { $sec = "0$sec"; } if ($min < 10) { $min = "0$min"; } if ($hour < 10) { $hour = "0$hour"; } $month = ($mon + 1); $date_now = "$month/$mday $hour:$min"; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } if($buffer){ @pairs = split(/&/,$buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if($name eq "chat_name"){$cnr = $value;} $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; &jcode'convert(*value,'sjis'); &tag_c; $FORM{$name} = $value; } $chat = $FORM{'chat'}; $chat_name = $FORM{'chat_name'}; $reld = $FORM{'reld'}; $size = $FORM{'size'}; if($chat){ if($chat_name){$cnw = $chat_name;} else{ $cnw = "↓これだ〜れ?
????"; } $cnw2 = $cnw; $cnw2 =~ s/<[^>]*[^<]*>//g; if ($chat =~ /^「「「.*」」」$/i){&s_t;} $id = $ENV{'REMOTE_ADDR'}; if ($chat =~ /^[al]*clear$/i){&clear_log;} else{ open(LOG,">>$log_file"); print LOG "($date_now)($id)
$cnw:$chat
\n"; close(LOG); #以下i-modeのログ書き込み $chat =~ s/<[^>]*[^<]*>//g; open(LOG,">>$log_file_i"); print LOG "$cnw2:$chat
\n"; close(LOG); } } } open(DB,"$log_file"); @logs2 = ; close(DB); $log_l = @logs2; $cnp = $chat_name; $chat_name =~ s//>/g; $chat_name =~ s/"/"/g; @logs = reverse @logs2; @logs = @logs[0..$log-1]; if ($log_l >= $log*3){ &l_slim; } print "Content-type: text/html\n\n"; if ($reld == 0) { } else { print "\n"; } print "$title\n"; print "\n"; &s_tr; print "$st
\n"; if ($chat_name){ print "Message:(Nickname = $cnpchange\n"; } else{ print "Nickname:
Message:\n"; } print "\n"; print "\n"; print "Refresh:\n"; print "
\n"; print "SIZE:"; print "1\n"; print "2\n"; print "3\n"; print "4\n"; print "5\n"; print "6\n"; print "7\n"; print "

\n"; print @logs; print "

G-chat
Made by GANMO
\n"; print "\n"; sub clear_log{ if($chat eq "allclear"){ open(LOG,">$log_file"); print LOG "
$cnw"; print LOG 'が過去を清算しました'; print LOG "
($date_now/$id)

\n"; close(LOG); } if($chat eq "clear"){ open(DB,"$log_file"); @ines = ; close(DB); open(LOG,">$log_file"); foreach $line (@ines) { if ($line =~ /.*$id.*$cnw.*/) {} else{ print LOG "$line"; } } print LOG "
$cnw"; print LOG 'の証拠隠滅工作'; print LOG "
($date_now/$id)

\n"; close(LOG); } } sub s_t{ $chat2=$chat; $chat2 =~ s/^「「「//g; $chat2 =~ s/」」」$//g; if ($chat2 eq "消去"){$chat2 = "";} else{$chat2 ="

$chat2

" ;} open(SUB_T,">$sub_file"); print SUB_T "$chat2"; close(SUB_T); } sub s_tr{ open(SUB_T,"$sub_file"); $st =(); close(SUB_T); } sub tag_c { if ($value =~ /