#! /usr/local/bin/perl # #ゆいちゃっとPro1.0(chat.cgi) # 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}/; $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{#ノンフレームの発言欄ここから &hide; print <<"_HTML_"; $body
$titleおなまえ:$name $hiddenログ行数:$logw $kao
発言: $hidden
(変更)
_HTML_ }#ノンフレームの発言欄ここまで #参加者表示 $num = @sanka3; print "参加者($num):"; print "@sanka3
\n"; #ログ表示 &readlog if(!@lines); (@lines < $window) || (@lines = @lines[0 .. $window - 1]); print @lines; print "
ゆいちゃっと Pro(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);#サーバ負荷を少しでも減らすため.... }#get END sub write { &tag if ($chat=~s/\t/= 0 ); $line = '' if ($line=~/$chat/i); } $chat = '♪〜'; } if ($chat eq '退室') { $value = "管理人 > $nameさん、またきておくれやすぅ。($date $host)
\n"; &writelog; print "Location: $endpage\n\n"; &ended; }elsif ($email) { $value = "$name |> $chat $emoji($date $host)
\n"; }else { $value = "$name > $chat $emoji($date $host)
\n"; } &count;#発言ランキングがいらなければ、削除。 &writelog; }#write END sub tag{ #このタグ閉じは、正しく閉じてある場合も余分に閉じます。(苦笑) $chat =~ s/
]*)>(.*)/$1/;
		$tag =~s/^\/(.*)//;
		$tag =~s/^([^\s]*).*/$1/;
	} 
	$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);
#ランキングファイルのクリアです。rankingclearは、他の単語に変えてね。
if($chat eq 'rankingclear') { 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__