#! /usr/local/bin/perl # #ゆいちゃっとPro1.0(tool.cgi) # #オプションCGI(ロムチェック&発言ランキング) require './pref.cgi'; &init; &jikan; print "Content-type: text/html\n\n"; if($ENV{'QUERY_STRING'} eq 'rom'){ &romcheck; }elsif($ENV{'QUERY_STRING'} eq 'rank'){ &rank; } print "えら〜??\n"; &ended; sub romcheck{ print "アクセス情報\n"; print "\n"; print "$body\n"; print "$titleの参加者および、ロムの一覧です。(60秒リロード)
"; open(DBS,"$sanka_file") || &ended; @lines = ; close(DBS); foreach $line (@lines) { ($timerec, $cname, $host,$dmy) = split(/\t/, $line); if( $times-60 < $timerec){ $time2=$times-$timerec; print "$cname($time2 秒前)
"; } } print "
\n"; print "とりあえず、話題に入れない初心者と、忙しい常連さんのロムは容認してます...ゆいは..。
\n"; print "名前のところには、mailtoでホスト名が入ってます。
\n"; print "ここをクリックしても意味ありません。
\n"; print "\n"; &ended; }#romcheck END sub rank{ $mini=3;#記録とする発言回数の下限 open(DBS,"$rank_file") || &ended; @lines = ; close(DBS); foreach $line (@lines) { ($name2, $count,$time2,$host2) =split(/\t/, $line); if( $times-10*24*60*60 > $time2){ $line=''; next;} $counts{$name2}=$count; ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime($time2); $min = "0$min" if ($min < 10); $month++; $youbi = ('日','月','火','水','木','金','土') [$wday]; $date2 = "$month/$mday($youbi)$hour:$min"; $dates{$name2}=$date2; $hosts{$name2}=$host2; } open(DB,">$rank_file") || &ended; print DB @lines; close(DB); print "発言らんきんぐ\n"; print "$body"; print "$titleでの発言らんきんぐ〜です。\n"; print "

\n"; print "\n"; print "\n"; foreach (sort { $counts{$b} <=> $counts{$a} } keys %counts) { last if ($counts{$_} < $mini); print "\n"; } print "
おなまえ発言回数最終発言時刻ホスト情報
$_$counts{$_}$dates{$_}$hosts{$_}

\n"; print "\n"; &ended; }#rank END __END__