#! /usr/bin/perl #うまく動かない時は↑を #! /usr/local/bin/perl #ってするといいかも・・・ # # かえでちゃっとCute.(ゆいちゃっとNT.) Ver.1.0 # require './jcodeLE.pl'; require './pref.cgi'; $| = 1; &init; &decode; &jikan; &get; &write if ($chat); &sanka; &html; &ended(); exit; sub html { #$buffer =~s/&chat=.*&/&/;$buffer =~s/reload=[\d]*/reload=${reload}/; $vname = $name; $buffer = "mode=" . $mode . "&email=&reload=" . $reload . "&color=" . $color . "&name=" . &encode($vname) . "&window=" . $window . "&fcimg=" . $fcimg . "&cute=" . $cute; $link = "./chat.cgi?${buffer}"; print "Content-type: text/html\n\n"; print "$title$metacode\n"; if($mode eq 'checked' ){ print "\n" if($reload); print "$body[リロード]\n"; }else{#ノンフレームの発言欄ここから $denpolink="(電報機能\)" if($denpo); &hide; print <<"_HTML_"; $body
$titleおなまえ:$name キュート機能\:利用する。
$hiddenログ行数:$logw $kao $lmojicolor
発言: $hidden
(変更)$denpolink
_HTML_ }#ノンフレームの発言欄ここまで #参加者表示 if($romnum && $romnprn){print "ROM($romnum)★";} $num = @sanka3; print "参加者($num):"; print "@sanka3
\n"; #ログ表示 &readlog if(!@lines); $i=1; foreach $line (@lines) { last if($i > $window); ($vname, $vcolor,$vemail,$vchat,$vflag,$vdate,$vhostnm,$vhostip,$vtimes,$vsecretip,$vsecretnm,$vfcimg,$dmy) = split(/\t/, $line); if($logform == 1){$hostst = $vhostnm;} elsif($logform == 2){$hostst = "";} elsif($logform == 3){$hostst = $vhostip;} elsif($logform == 4){$hostst = "";} elsif($logform == 5){$hostst = "";} elsif($logform == 6){$hostst = "$vhostnm";} else{$hostst = "";} if($vemail){$lemail = "|>";} else{$lemail = ">";} if($vfcimg && ($cute eq "checked")){$lfcimg = "";} else{$lfcimg = "";} if($vsecretip){ #電報の場合、$vsecretipにホスト名が入っている。(電報のフィルタリング) if((($host eq $vsecretip) && ($name eq $vsecretnm)) || (($host eq $vhostnm) && ($name eq $vname))){ $i++; $vsecretms = $secretms;$vsecretms =~ s//$vsecretnm/ig;$vsecretms =~ s//$vname/ig; print "$lfcimg$vname $lemail $vchat ($vdate $hostst)$vsecretms
\n"; } } elsif($vchat){ $i++; print "$lfcimg$vname $lemail $vchat ($vdate $hostst)
\n"; } }#foreach print "
かえでちゃっと Cute
Based On ゆいちゃっと NT(Free)
\n";#この行だけは消さないでっ!! }#html END sub get{ $chat = $FORM{'chat'}; $emoji = $FORM{'emoji'};$emoji =~ s/\t/</eg; $emoji = '(=^^=)' if($emoji eq '(=^^=)'); $emoji ='' if($emoji =~/なし/); $reload = 30 if($reload!=0 && $reload<30); $reload = $reload+5 if($reload);#サーバ負荷を少しでも減らすため.... $mojicolor = $FORM{'mojicolor'}; @color3 = split(/"/,$mojicolor);$mojicolor = $color3[0]; &refchk;#書き込み許可URL以外の書き込み対策 }#get END sub write { &tag if ($chat=~s/\t/= 0 ))) && (index($line,$chat) >= 0 )); } $chat = '♪〜' } elsif ($chat eq 'cut'){ foreach $line (@lines) { #画像消去 $line = '' if ($line =~/= 0 ); } $chat = '♪〜' } #文字修飾 $decoration ="color=$mojicolor" if($mojicolor); $decoration .=" size=$FORM{'mojisize'}" if($FORM{'mojisize'}); $chat ="$chat" if($decoration); $chat ="$chat" if($FORM{'bold'} eq 'on'); $chat ="$chat" if($FORM{'ital'} eq 'on'); $outms = "$name$outmessage"; #連続同一発言禁止 $i = 1; $j = 0; if($chat eq '退室'){$tchat=$outms;$name=$adminname;$color=$admicolor;$fcimg=$adminimg;} else{$tchat="$chat $emoji";} foreach $line (@lines) { last if($i > $repavoid); ($vname, $vcolor,$vemail,$vchat,$vflag,$vdate,$vhostnm,$vhostip,$vtimes,$vsecretip,$vsecretnm,$vfcimg,$dmy) = split(/\t/, $line); if(($vname eq $name) && ($vchat eq $tchat) && ($vhostnm eq $host) && ($vsecretip eq '')){$chat='';} $i++; } #連続同一ホスト発言禁止(発言間隔制限) foreach $line (@lines) { last if($j); ($vname, $vcolor,$vemail,$vchat,$vflag,$vdate,$vhostnm,$vhostip,$vtimes,$vsecretip,$vsecretnm,$vfcimg,$dmy) = split(/\t/, $line); if(($vhostnm eq $host) && ($secavoid >= ($times - $vtimes))){$chat='';$j=1;} } $secret = "\t"; if($chat) { $value = "$name\t$color\t$email\t$tchat\t\t$date\t$host\t$hostip\t$times\t$secret\t$fcimg\t\n"; } else{ $value =''; } &count if (($rank_file) && ($chat ne '退室')); #発言ランキング &writelog; if(($name eq $adminname) && ($color eq $admicolor)){ print "Location: $endpage\n\n"; &ended; } }#write END sub tag{ #このタグ閉じは、正しく閉じてある場合も余分に閉じます。(苦笑) $ntags = @denytags; $chat2 = $chat; $l0 = length($chat2); $chat2 =~ s///ig;$l2 = length($chat2); $chat2 =~ s/'//ig;$l3 = length($chat2);$l4 = ($l2 - $l3) % 2; $chat2 =~ s/"//ig;$l5 = ($l3 - length($chat2)) % 2; if((($l0-$l1) > ($l1-$l2)) || $l4 || $l5 || ($tgeml && !($email))){$ntags = 0;} if($ntags > 0){ foreach $denytag ( @denytags ){ $chat =~ s/$denytag//ig; }#禁止タグ処理 @tags = split( /]*)>(.*)/$1/; $tag =~s/^\/(.*)//; $tag =~s/^([^\s]*).*/$1/; } } else { $chat =~ s//>/ig; } $chat.='>' if($chat=~/<\/$/); @tags = reverse( @tags ); foreach $tag ( @tags ){ next if($tag =~/(img|^hr$|^br$)/i); $chat.="" if($tag); } $chat.='">タグえらー?' if( ($chat=~/.*<\/A>/i) ); $chat =~ s/; close(LOG); } $flag=1; foreach $line (@line2) { ($name2, $count,$date2,$dmy) = split(/\t/, $line); next if($name2 ne $name); $count++; $flag = 0; $line = "$name\t$count\t$times\t$host\n"; last; }#foreach push(@line2,"$name\t1\t$times\t$host\n") if($flag); #ランキングファイルのクリアです。$rankresetが空のときは無効です。 if(($rankreset ne "") && ($chat eq $rankreset)) { undef(@line2); $value=''; } open(LOG,">$rank_file") || &ended('$rank_file write error'); eval 'flock(LOG,2);'; seek(LOG,0,0); print LOG @line2; eval 'flock(LOG,8);'; close(LOG); }#count END __END__