local($num, $type) = @_;
srand;
#"$num\8cÂ\82Ì$type\96Ê\91Ì";
- local($ret) = $num."d".$type.": ";
+ local($ret) = $num."d".$type.": ";
for ($i=0; $i<$num; $i++) {
$d = int(rand($type)) + 1;
$sum += $d;
$IN{'line'} = $query->param('line');
foreach $key (keys %IN) {
- # \95¶\8e\9a\83R\81[\83h\82ðEUC\95Ï\8a· (\95¶\8e\9a\83R\81[\83h\82Ì\93\9d\88ê\82Æ\83T\83j\83^\83C\83W\83\93\83O\82Ì\82½\82ß)
- local($c) = &jcode::getcode(\$IN{$key});
- #print "code: $c\n";
- if ($c eq 1 || $c eq 2) {
- &jcode::convert(\$IN{$key}, 'euc');
- }
-
- # \83^\83O\8f\88\97\9d (\83T\83j\83^\83C\83W\83\93\83O)
- $IN{$key} =~ s/&/&/g;
- $IN{$key} =~ s/</</g;
- $IN{$key} =~ s/>/>/g;
- $IN{$key} =~ s/"/"/g; # "
- $IN{$key} =~ s/\r//g;
- $IN{$key} =~ s/\n//g;
+ # \95¶\8e\9a\83R\81[\83h\82ðEUC\95Ï\8a· (\95¶\8e\9a\83R\81[\83h\82Ì\93\9d\88ê\82Æ\83T\83j\83^\83C\83W\83\93\83O\82Ì\82½\82ß)
+ local($c) = &jcode::getcode(\$IN{$key});
+ #print "code: $c\n";
+ if ($c eq 1 || $c eq 2) {
+ &jcode::convert(\$IN{$key}, 'euc');
+ }
+
+ # \83^\83O\8f\88\97\9d (\83T\83j\83^\83C\83W\83\93\83O)
+ $IN{$key} =~ s/&/&/g;
+ $IN{$key} =~ s/</</g;
+ $IN{$key} =~ s/>/>/g;
+ $IN{$key} =~ s/"/"/g; # "
+ $IN{$key} =~ s/\r//g;
+ $IN{$key} =~ s/\n//g;
# \95¶\8e\9a\83R\81[\83h\82ð\8f\88\97\9d\8cn\82É\8d\87\82í\82¹\82é
local($code) = 'euc';
$code = 'sjis';
} elsif ($CONF{'charset'} eq 'ISO-2202-JP') {
$code = 'jis';
- }
+ }
&jcode::convert(\$IN{$key}, $code);
}
}
local($client) = $_[0];
local($find)=0;
open(DENY, "$CONF{'denyfile'}")
- || &error("Open Error : denyfile : $CONF{'denyfile'} : $!");
+ || &error("Open Error : denyfile : $CONF{'denyfile'} : $!");
while (<DENY>) {
- s/\n//g;
- next if (!$_);
- s/\*/\.\*/g;
- if ($client =~ /$_/i) { $find=1; last; }
+ s/\n//g;
+ next if (!$_);
+ s/\*/\.\*/g;
+ if ($client =~ /$_/i) { $find=1; last; }
}
close(DENY);
if ($find) { &error($CONF{'denymsg'}); }
local(@temp) = ();
local($match)=0;
foreach (@lines) {
- local($cip) = (split(/<>/))[5];
- if ($client eq $cip) {
- $match=1;
- } else {
- push(@temp, $_);
- }
+ local($cip) = (split(/<>/))[5];
+ if ($client eq $cip) {
+ $match=1;
+ } else {
+ push(@temp, $_);
+ }
}
if ($match) {
- $IN{'comment'}="All Clear (^-^)v";
- return @temp;
+ $IN{'comment'}="All Clear (^-^)v";
+ return @temp;
}
}
# \96¼\91O\82Ì\93ü\97Í\82ª\82È\82¯\82ê\82Î\83G\83\89\81[
if ($IN{'name'} eq "") {
- &error("\8cä\8bL\96¼\8aè\82¢\82Ü\82·\81B");
+ &error("\8cä\8bL\96¼\8aè\82¢\82Ü\82·\81B");
}
# \83g\83\8a\83b\83v\8f\88\97\9d
local($tripped) = &getTrip($IN{'name'});
local($name, $email, $color)= ("", "", "");
# \93ü\8eº\83\82\81[\83h
if ($mode eq 'login') {
- # \93ü\8eº\83\81\83b\83Z\81[\83W\90Ý\92è
- $IN{'comment'} = "$tripped $CONF{'in_msg'}";
- if ($CONF{'showip'}) {
- $IN{'comment'} .= " <$client>";
- }
- $email = "";
- $name = $CONF{'navi'};
- $color = $CONF{'navicolor'};
+ # \93ü\8eº\83\81\83b\83Z\81[\83W\90Ý\92è
+ $IN{'comment'} = "$tripped $CONF{'in_msg'}";
+ if ($CONF{'showip'}) {
+ $IN{'comment'} .= " <$client>";
+ }
+ $email = "";
+ $name = $CONF{'navi'};
+ $color = $CONF{'navicolor'};
}
# \91Þ\8eº\83\82\81[\83h
elsif ($mode eq 'logout') {
- $IN{'comment'} = "$tripped $CONF{'out_msg'}";
- $email = "";
- $name = $CONF{'navi'};
- $color = $CONF{'navicolor'};
- $bye=1;
+ $IN{'comment'} = "$tripped $CONF{'out_msg'}";
+ $email = "";
+ $name = $CONF{'navi'};
+ $color = $CONF{'navicolor'};
+ $bye=1;
}
# \92Ê\8fí\83\82\81[\83h
else {
# \93ü\97Í\82ª\82È\82¢\8fê\8d\87\82Í\82»\82Ì\82Ü\82Ü\95Ô\82é
if ($IN{'comment'} eq "") { return; }
- if ($IN{'email'} eq "") {
- $name = "<B>$CONF{'pointer'}</B>";
- }
- else {
- $name = "<B><a href=\"mailto:$IN{'email'}\">";
- $name .= "$CONF{'pointer'}</a></B>";
- }
- $name .= " $tripped ";
- $email = $IN{'email'};
- $color = $IN{'color'};
+ if ($IN{'email'} eq "") {
+ $name = "<B>$CONF{'pointer'}</B>";
+ }
+ else {
+ $name = "<B><a href=\"mailto:$IN{'email'}\">";
+ $name .= "$CONF{'pointer'}</a></B>";
+ }
+ $name .= " $tripped ";
+ $email = $IN{'email'};
+ $color = $IN{'color'};
}
# \83\8d\83O\83t\83@\83C\83\8b\82Ì\83\8d\83b\83N\8aJ\8en
# \94\8c¾\8f\9c\8b\8e\8f\88\97\9d (\83I\83v\83V\83\87\83\93)
# \8f\9c\8b\8e\83R\83}\83\93\83h\82ð\93ü\97Í\82·\82é\82±\82Æ\82Å\8e©\95ª\82Ì\8bL\8e\96\82ð\8dí\8f\9c
if ($CONF{'clearlog'} && $IN{'comment'} eq $CONF{'clearcom'}) {
- @lines = &clear($client, @lines);
+ @lines = &clear($client, @lines);
}
-
+
# \8dÅ\91å\8bL\8e\96\90\94\82Ü\82Å\8dí\82é
while ($CONF{'max'} <= @lines) {
- pop(@lines);
+ pop(@lines);
}
# \8e\9e\8aÔ\82ð\8eæ\93¾
print "Content-type: $CONF{'content-type'}\n";
# GZIP\88³\8fk\91Î\89\9e\83R\81[\83h (2006/02/10)
if (${'HTTP_ACCEPT_ENCODING'} =~ /gzip/ && $gzip ne '') {
- if (${'HTTP_ACCEPT_ENCODING'} =~ /x-gzip/) {
- print "Content-encoding: x-gzip\n";
- } else {
- print "Content-encoding: gzip\n";
- }
- open (STDOUT, "|$gzip -1 -c"); # \88³\8fk\82Í\8dÅ\91¬(-1)\82Å
+ if (${'HTTP_ACCEPT_ENCODING'} =~ /x-gzip/) {
+ print "Content-encoding: x-gzip\n";
+ } else {
+ print "Content-encoding: gzip\n";
+ }
+ open (STDOUT, "|$gzip -1 -c"); # \88³\8fk\82Í\8dÅ\91¬(-1)\82Å
}
# GZIP\88³\8fk\91Î\89\9e\81A\82±\82±\82Ü\82Å
print "\n"; # \83w\83b\83_\8fI\97¹
# \83N\83b\83L\81[\82É\83\8a\83\8d\81[\83h\8e\9e\8aÔ\81^\8ds\90\94\8ew\92è\82ª\82È\82¢\8fê\8d\87\82Í\8f\89\8aú\92l\82ð\91ã\93ü
if ($CK{'retime'} eq "") { $CK{'retime'} = $CONF{'retime'}; }
if ($CK{'line'} eq "") { $CK{'line'} = $CONF{'line'}; }
-
+
$formsrc = "$CONF{'chatcgi'}?room=$IN{'room'}&mode=form&retime=$CK{'retime'}&line=$CK{'line'}";
$logsrc = "$CONF{'chatcgi'}?room=$IN{'room'}&mode=view&retime=$CK{'retime'}&line=$CK{'line'}";
sub genReloadTimeSelection {
# \93ü\97Í\82É\82æ\82é\90Ý\92è\82ª\82 \82ê\82Î\82»\82¿\82ç\82ð\97D\90æ
if ($IN{'retime'} ne "") {
- $CK{'retime'} = $IN{'retime'};
+ $CK{'retime'} = $IN{'retime'};
}
# \8bó\82È\82ç\82Î\8f\89\8aú\92l\82É\90Ý\92è
if ($CK{'retime'} eq "") {
- $CK{'retime'} = $CONF{'retime'};
+ $CK{'retime'} = $CONF{'retime'};
}
local($reload) = "\8dX\90V <select name=retime>\n";
foreach (@reload) {
- if ($CK{'retime'} == $_) {
- $reload .= "<option value=\"$_\" selected>$_\95b\n";
- } else {
- $reload .= "<option value=\"$_\">$_\95b\n";
- }
+ if ($CK{'retime'} == $_) {
+ $reload .= "<option value=\"$_\" selected>$_\95b\n";
+ } else {
+ $reload .= "<option value=\"$_\">$_\95b\n";
+ }
}
$reload .= "</select>\n";
return $reload;
sub genLineNumSelection {
# \93ü\97Í\82É\82æ\82é\90Ý\92è\82ª\82 \82ê\82Î\82»\82¿\82ç\82ð\97D\90æ
if ($IN{'line'} ne "") {
- $CK{'line'} = $IN{'line'};
+ $CK{'line'} = $IN{'line'};
}
# \8bó\82È\82ç\82Î\8f\89\8aú\92l\82É\90Ý\92è
if ($CK{'line'} eq "") {
- $CK{'line'} = $CONF{'line'};
+ $CK{'line'} = $CONF{'line'};
}
local($lines) = "\8ds\90\94 <select name=line>\n";
foreach (@line) {
- if ($CK{'line'} == $_) {
- $lines .= "<option value=\"$_\" selected>$_\8ds\n";
- } else {
- $lines .= "<option value=\"$_\">$_\8ds\n";
- }
+ if ($CK{'line'} == $_) {
+ $lines .= "<option value=\"$_\" selected>$_\8ds\n";
+ } else {
+ $lines .= "<option value=\"$_\">$_\8ds\n";
+ }
}
$lines .= "</select><br>\n";
return $lines;
sub genColorRadioBottun {
# \93ü\97Í\82É\82æ\82é\90Ý\92è\82ª\82 \82ê\82Î\82»\82¿\82ç\82ð\97D\90æ
if ($IN{'color'} ne "") {
- $CK{'color'} = $IN{'color'};
+ $CK{'color'} = $IN{'color'};
}
# \8bó\82È\82ç\82Î\8f\89\8aú\92l\82É\90Ý\92è
if ($CK{'color'} eq "") {
- $CK{'color'} = $CONF{'color'};
+ $CK{'color'} = $CONF{'color'};
}
local($colors) = "<B>\95¶\8e\9a\90F\91I\91ð</B><BR><BR>\n";
local($half) = int (@COLORS / 2); # \94¼\95ª\82É\8a\84\82é
local($i=0);
foreach (@COLORS) {
- $i++;
- if ($CK{'color'} eq $_) {
- $colors .= "<input type=radio name=color value=\"$_\" checked>";
- } else {
- $colors .= "<input type=radio name=color value=\"$_\">";
- }
- $colors .= "<font color=\"$_\"><B>**</B></font>\n";
- if ($i == $half) { $colors .= "<br>\n"; }
+ $i++;
+ if ($CK{'color'} eq $_) {
+ $colors .= "<input type=radio name=color value=\"$_\" checked>";
+ } else {
+ $colors .= "<input type=radio name=color value=\"$_\">";
+ }
+ $colors .= "<font color=\"$_\"><B>**</B></font>\n";
+ if ($i == $half) { $colors .= "<br>\n"; }
}
return $colors;
}
sub genColorSelection {
# \93ü\97Í\82É\82æ\82é\90Ý\92è\82ª\82 \82ê\82Î\82»\82¿\82ç\82ð\97D\90æ
if ($IN{'color'} ne "") {
- $CK{'color'} = $IN{'color'};
+ $CK{'color'} = $IN{'color'};
}
# \8bó\82È\82ç\82Î\8f\89\8aú\92l\82É\90Ý\92è
if ($CK{'color'} eq "") {
- $CK{'color'} = $CONF{'color'};
+ $CK{'color'} = $CONF{'color'};
}
local($colors) = "\95¶\8e\9a\90F <select name=color>\n";
for ($i = 0; $i < scalar(@COLORS); $i++) {
- if ($IN{'color'} eq $COLORS[$i]) {
- $colors .= "<option value=\"$COLORS[$i]\" selected>$IROIRO[$i]\n";
- } else {
- $colors .= "<option value=\"$COLORS[$i]\">$IROIRO[$i]\n";
- }
+ if ($IN{'color'} eq $COLORS[$i]) {
+ $colors .= "<option value=\"$COLORS[$i]\" selected>$IROIRO[$i]\n";
+ } else {
+ $colors .= "<option value=\"$COLORS[$i]\">$IROIRO[$i]\n";
+ }
}
$colors .= "</select>\n";
}
local ($face) = "\82©\82¨\95¶\8e\9a <select name=\"face\">";
$face .= "<option value=\"\">\82È\82µ\n";
foreach (@faces) {
- $face .= "<option value=\"$_\">$_\n";
+ $face .= "<option value=\"$_\">$_\n";
}
$face .= "</select>\n";
return $face;
if ($CONF{'loglink'} == 1) {
$loglink = &genLogLinkString($IN{'room'});
} elsif ($CONF{'loglink'} == 2) {
- $loglink = &genPullDown();
+ $loglink = &genPullDown();
}
local($login) = &genLoginInput();
if ($CONF{'loglink'} == 1) {
$loglink = &genLogLinkString($IN{'room'});
} elsif ($CONF{'loglink'} == 2) {
- $loglink = &genPullDown();
+ $loglink = &genPullDown();
}
local($chat) = &genChatInput();
# \83\89\83\93\83L\83\93\83O\82Ì\90¶\90¬
if ($CONF{'ranking'}) {
- local($ranking) = &genRanking();
+ local($ranking) = &genRanking();
}
# \83\8d\83O\8f\91\82«\8d\9e\82Ý\8f\88\97\9d
# \83\81\83\93\83o\81[\88ê\97\97\8eæ\93¾
open(MEM, "<$memfile")
- || &error("Open Error : memfile : $memfile");
+ || &error("Open Error : memfile : $memfile");
local(@line) = <MEM>;
close(MEM);
# \8c»\8dÝ\8e\9e\8d\8f\82ð\8eæ\93¾
local($nowtime) = time;
foreach (@line) {
- ($time0, $name0, $client0) = split(/<>/);
-
- # \88ê\92è\8e\9e\8aÔ\88È\8fã\94\8c¾\82Ì\82È\82¢\8eÒ\82Í\8dí\8f\9c
- if ($nowtime - $CONF{'memexp'} > $time0) { next; }
-
- # \83N\83\89\83C\83A\83\93\83gIP\82ª\93¯\88ê\82©\82Â\96¼\91O\82ª\88ê\8f\8f\82Å\82 \82ê\82Î\8dX\90V\8f\88\97\9d\82ð\82·\82é
- elsif ($client0 eq $client && $name0 eq $tripped) {
- # \91Þ\8eº\8eÒ\82Í\8dí\8f\9c
- if ($mode eq 'logout') { next; }
-
- # \8e\9e\8aÔ\82Æ\96¼\91O\82ð\8dX\90V\82µ\82Ä\92Ç\89Á
- push (@new, "$nowtime<>$tripped<>$client<>\n");
- $name0 = $tripped;
- $update=1;
- }
- # \82»\82ê\88È\8aO\82Í\96â\93\9a\96³\97p\82Å\8dX\90V\97p\94z\97ñ @new \82É\92Ç\89Á
- else { push(@new, $_); }
-
- # \8eQ\89Á\8eÒ\95\\8e¦\97p\95¶\8e\9a\97ñ\82ð\8dì\90¬ (\8bô\90\94\8aï\90\94\82Å\83}\81[\83N\95Ï\8dX)
- if (!$even) {
- $member .= "$name0\81\9a"; $even=1;
- }
- else {
- $member .= "$name0\81\99"; $even=0;
- }
- }
-
+ ($time0, $name0, $client0) = split(/<>/);
+
+ # \88ê\92è\8e\9e\8aÔ\88È\8fã\94\8c¾\82Ì\82È\82¢\8eÒ\82Í\8dí\8f\9c
+ if ($nowtime - $CONF{'memexp'} > $time0) { next; }
+
+ # \83N\83\89\83C\83A\83\93\83gIP\82ª\93¯\88ê\82©\82Â\96¼\91O\82ª\88ê\8f\8f\82Å\82 \82ê\82Î\8dX\90V\8f\88\97\9d\82ð\82·\82é
+ elsif ($client0 eq $client && $name0 eq $tripped) {
+ # \91Þ\8eº\8eÒ\82Í\8dí\8f\9c
+ if ($mode eq 'logout') { next; }
+
+ # \8e\9e\8aÔ\82Æ\96¼\91O\82ð\8dX\90V\82µ\82Ä\92Ç\89Á
+ push (@new, "$nowtime<>$tripped<>$client<>\n");
+ $name0 = $tripped;
+ $update=1;
+ }
+ # \82»\82ê\88È\8aO\82Í\96â\93\9a\96³\97p\82Å\8dX\90V\97p\94z\97ñ @new \82É\92Ç\89Á
+ else { push(@new, $_); }
+
+ # \8eQ\89Á\8eÒ\95\\8e¦\97p\95¶\8e\9a\97ñ\82ð\8dì\90¬ (\8bô\90\94\8aï\90\94\82Å\83}\81[\83N\95Ï\8dX)
+ if (!$even) {
+ $member .= "$name0\81\9a"; $even=1;
+ }
+ else {
+ $member .= "$name0\81\99"; $even=0;
+ }
+ }
+
# \8dX\90V\8f\88\97\9d\88È\8aO\82Å\83\8d\83O\83A\83E\83g\82à\82µ\82Ä\82¢\82È\82¢\82È\82ç\82Î\90V\8bK\8eQ\89Á\8eÒ\82ð\92Ç\89Á
if (!$update && !$bye) {
- if ($IN{'name'} ne $client) {
- push(@new, "$nowtime<>$tripped<>$client<>\n");
- if (!$even) {
- $member .= "$tripped\81\9a";
- }
- else {
- $member .= "$tripped\81\99";
- }
- }
+ if ($IN{'name'} ne $client) {
+ push(@new, "$nowtime<>$tripped<>$client<>\n");
+ if (!$even) {
+ $member .= "$tripped\81\9a";
+ }
+ else {
+ $member .= "$tripped\81\99";
+ }
+ }
}
# \83t\83@\83C\83\8b\82ð\8dX\90V\82·\82é
if ($IN{'mode'} || $IN{'retime'}) {
- open(MEM,">$memfile")
- || &error("Write Error : memfile : $memfile");
- print MEM @new;
- close(MEM);
+ open(MEM,">$memfile")
+ || &error("Write Error : memfile : $memfile");
+ print MEM @new;
+ close(MEM);
}
# \83\8d\83b\83N\89ð\8f\9c
# \83\8a\83\8d\81[\83h\83w\83b\83_
local($extra) = '';
if ($IN{'retime'} != 0) {
- local($ename) = &url_enc($IN{'name'});
- local($script) = "$CONF{'chatcgi'}?room=$IN{'room'}&mode=view&retime=$IN{'retime'}&line=$IN{'line'}&name=$ename";
- $extra = "<meta http-equiv=\"refresh\"";
- $extra .= " content=\"$IN{'retime'}; URL=$script\">\n";
+ local($ename) = &url_enc($IN{'name'});
+ local($script) = "$CONF{'chatcgi'}?room=$IN{'room'}&mode=view&retime=$IN{'retime'}&line=$IN{'line'}&name=$ename";
+ $extra = "<meta http-equiv=\"refresh\"";
+ $extra .= " content=\"$IN{'retime'}; URL=$script\">\n";
}
&printHeader($extra);
print "<table width='100%'><tr><td>$member</td>\n";
print "<td align=right>\83\8a\83\8d\81[\83h\81F ";
if ($IN{'retime'} == 0) {
- print "\8eè\93®\83\82\81[\83h";
+ print "\8eè\93®\83\82\81[\83h";
} else { print "$IN{'retime'}\95b"; }
print " \8ds\90\94: $IN{'line'}\8ds</td></tr></table>\n";
local($datfile) = $CONF{'datdir'}."/".$IN{'room'}.".dat";
print &formatDat($datfile, $IN{'line'}, 'normal', $IN{'reverse'});
-
+
print $query->hr . "\n";
# \92\98\8dì\8c \82ð\95\\8e¦\81i\8dí\8f\9c\8bÖ\8e~\81j