){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($in{perso} eq "nokeep"){$name=&checkname($name);}
$count{$name}++;
$total++;
}
close(FILE);
$i=0;
foreach (keys(%count)){
$content{"${count{$_}}_${i}"}="$_";
$i++;
}
@tmp=keys(%content);
@sortdata=reverse(sort({$a<=>$b}@tmp));
print "\n";
foreach $data (@sortdata){
print "";
print "| $content{$data} | \n";
$data =~ s/^(\d\d*)_\d\d*/$1/;
print "";
$linemax=$sortdata[0];
if ($linemax == 0){last;}
$width=($data/$linemax)*$rightend;
if ($width != 0){
print " \n";
}
# for($j=0;$j<$data;$j=$j+$inc){
# print "*";
# }
if ($total == 0){last;}
$pars=($data/$total)*100;
print " $data";
printf(" (%3.2f%%)",$pars);
print " |
";
print "";
}
print "
";
$people=$#sortdata+1;
print "
";
print "トータル=$total件、 延べ人数=";
print "$people";
print "人、一人平均=";
if ($people == 0){$people=1;}
$mean=$total/$people;
printf("%3.2f",$mean);
print "件
";
}
if ($in{choise} eq data6a){
$inc=2;
print "$titleprint\n";
&subtitle;
print "\n";
$realy=$in{y2}+1900;
print "$realy年$in{m2}月のデータ";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($date =~ /^$in{y2}_$in{m2}_\d\d?$/){
if ($in{perso} eq "nokeep"){$name=&checkname($name);}
$count{$name}++;
$total++;
}
}
close(FILE);
$i=0;
foreach (keys(%count)){
$content{"${count{$_}}_${i}"}="$_";
$i++;
}
@tmp=keys(%content);
@sortdata=reverse(sort({$a<=>$b}@tmp));
$linemax=$sortdata[0];
print "\n";
foreach $data (@sortdata){
print "";
print "| $content{$data} | \n";
$data =~ s/^(\d\d*)_\d\d*/$1/;
print "";
if ($linemax == 0){last;}
$width=($data/$linemax)*400;
if ($width != 0){
print " \n";
}
# for($j=0;$j<$data;$j=$j+$inc){
# print "*";
# }
if ($total == 0){last;}
$pars=($data/$total)*100;
print " $data";
printf(" (%3.2f%%)",$pars);
print " |
";
print "";
}
print "
";
$people=$#sortdata+1;
print "
";
print "トータル=$total件、 延べ人数=";
print "$people";
print "人、一人平均=";
if ($people == 0){$people=1;}
$mean=$total/$people;
printf("%3.2f",$mean);
print "件
";
}
if ($in{choise} eq data6b){
$inc=20;
print "$titleprint\n";
&subtitle;
print "\n";
$realy=$in{y3}+1900;
print "$realy年のデータ";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($date =~ /^$in{y3}_\d\d?_\d\d?$/){
$name1=$name;
if ($in{perso} eq "nokeep"){$name=&checkname($name);}
$count{$name}++;
$total++;
}
}
close(FILE);
$i=0;
foreach (keys(%count)){
$content{"${count{$_}}_${i}"}="$_";
$i++;
}
@tmp=keys(%content);
@sortdata=reverse(sort({$a<=>$b}@tmp));
$linemax=$sortdata[0];
print "\n";
foreach $data (@sortdata){
print "";
print "| $content{$data} | \n";
$data =~ s/^(\d\d*)_\d\d*/$1/;
print "";
if ($linemax == 0){last;}
$width=($data/$linemax)*$rightend;
if ($width != 0){
print " \n";
}
# for($j=0;$j<$data;$j=$j+$inc){
# print "*";
# }
if ($total == 0){last;}
$pars=($data/$total)*100;
print " $data";
printf(" (%3.2f%%)",$pars);
print " |
";
print "";
}
print "
";
$people=$#sortdata+1;
print "
";
print "トータル=$total件、 延べ人数=";
print "$people";
print "人、一人平均=";
if ($people == 0){$people=1;}
$mean=$total/$people;
printf("%3.2f",$mean);
print "件
";
}
if ($in{choise} eq data6c){
$inc=2;
print "$titleprint\n";
&subtitle;
print "\n";
print "";
print "| 月 | ";
print "1位 | ";
print "2位 | ";
print "3位 | ";
print "
";
open(FILE,"< $filename");
$j=0;
while () {
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($in{perso} eq "nokeep"){$name=&checkname($name);}
$date =~ s/^(\d?\d\d_\d\d?)_\d\d?$/$1/;
if ($lastmon ne '' && $lastmon ne $date){
&mktbl;
$j=$j+1;
undef %count;
undef %content;
}
$count{"$name"}++;
$total++;
$lastmon=$date;
}
close(FILE);
&mktbl;
for($i=$j;$i>=0;$i=$i-1){
($ym,$a1,$a2,$b1,$b2,$c1,$c2)=split(/\,/,$tbl[$i]);
($yyy,$mmm)=split(/_/,$ym);
$yyy=$yyy+1900;
print "| $yyy年$mmm月 | ";
print "$a1 $a2件 | ";
print "$b1 $b2件 | ";
print "$c1 $c2件 | ";
print "
";
}
print "
";
}
sub mktbl {
$i=0;
foreach (keys(%count)){
$content{"${count{$_}}_$i"}="$_";
$i++;
}
@tmp = keys(%content);
@tmp1 = reverse(sort {$a<=>$b} @tmp);
$top=$tmp1[0];
$top =~ s/^(\d\d*)_\d\d*$/$1/;
$second=$tmp1[1];
$second =~ s/^(\d\d*)_\d\d*$/$1/;
$third=$tmp1[2];
$third =~ s/^(\d\d*)_\d\d*$/$1/;
$tbl[$j]="$lastmon,$content{$tmp1[0]},$top,$content{$tmp1[1]},$second,$content{$tmp1[2]},$third";
}
if ($in{choise} eq data7){
print "$titleprint\n";
&subtitle;
print "\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
$date =~ s/_(\d_\d?\d)$/_0${1}/;
$date =~ s/_(\d\d_)(\d)$/_${1}0${2}/;
$date =~ s/^(9\d_\d\d_\d\d)$/0${1}/;
$date2=$date;
$date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/;
$today2=$today;
$today2 =~ s/^(\d\d?\d?)..*/$1/;
if ($in{perso} eq "nokeep"){$name=&checkname($name);}
if ($today2 != $date){
$count{$name}=sprintf("%s_%s年%s_%s",$date2,$date,$today,$num);
} else {
$count{$name}="${date2}_${today}_${num}";
}
}
close(FILE);
foreach (keys(%count)){
$content{"$count{$_}"}="$_";
}
@tmp=keys(%content);
@sortdata=reverse(sort(@tmp));
print "";
foreach $today (@sortdata){
$today2 = $today;
$today2 =~ s/^\d?\d\d_\d\d_\d\d_(..*)_(\d\d*)$/$1/;
@darray = split(/[^\d]/,$today2);
@tmpaaa = split(/日[^\)]/,$today2);
$datex=$darray[0];
$tx=sprintf("%s月%s日(%s",$darray[2],$darray[4],$tmpaaa[1]);
$today2=sprintf("%s年%s",$datex+1900,$tx);
$mesnum=$2;
print "| $content{$today} | $today2 | #$mesnum |
\n";
}
print "
";
}
if ($in{choise} eq data10){
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
if ($name eq $hname){
if ($date =~ /^${in{y1}}_${in{m1}}_/){
$count{$date}++;
$total++;
}
}
}
close(FILE);
for ($i=1;$i<=$finday;$i++){
$date="${in{y1}}_${in{m1}}_${i}";
printf("%04d/%02d/%02d | ",$in{y1}+1900,$in{m1},$i);
$linemax=40;
$width=($count{$date}/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$count{$date};$j++){
# print "*";
# }
if ($count{$date} eq ""){$count{$date}=0;}
print " $count{$date}
";
}
$mean=$total/$finday;
print "---------------------
";
print "トータル=$total件、 一日平均=";
printf("%3.2f",$mean);
print "件
";
}
if ($in{choise} eq data11){
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
if ($name eq $hname){
$count{$date}++;
$total++;
}
}
close(FILE);
$i=0;
foreach (keys(%count)){
$content{"${count{$_}}_${i}"}="$_";
$i++;
}
@tmp=keys(%content);
@tmp1=reverse(sort({$a<=>$b}@tmp));
@sortdata=splice(@tmp1,0,30);
foreach $number (@sortdata){
$date=$content{$number};
($yy,$mm,$dd,$dummy)=split(/_/,$date);
printf("%04d/%02d/%02d | ",$yy+1900,$mm,$dd);
$linemax=20;
$width=($number/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$number;$j++){
# print "*";
# }
if ($number eq ""){$number=0;}
print " $count{$date}
";
}
$mean=$total/$finday;
print "---------------------
";
print "トータル=$total件、 一日平均=";
printf("%3.2f",$mean);
print "件
";
}
if ($in{choise} eq data12){
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
$i=0;
while (){
chop;
($num,$date,$name,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
if ($name eq $hname){
if ($i==0){$date1=$date;$num0=$num;}
$count{$date}++;
$i++;
}
}
close(FILE);
($yyy,$mmm,$ddd)=split(/_/,$date1);
($yyy2,$mmm2,$ddd2)=split(/_/,$date);
@timetmp=gmtime($time_offset);
$firstline=timelocal(0,0,0,$ddd,$mmm-1,$yyy,$timetmp[6],$timetmp[7],$timetmp[8]);
$endline=timelocal(0,0,0,$ddd2,$mmm2-1,$yyy2,$timetmp[6],$timetmp[7],$timetmp[8]);
@tmp=sort {$a<=>$b} values(%count);
$max=$tmp[$#tmp];
$total=$#tmp+1;
$yyy = $yyy + 1900;
$yyy2 = $yyy2 + 1900;
print "$yyy年$mmm月$ddd日から$yyy2年$mmm2月$ddd2日まで";
for ($i=0;$i<=$max;$i++){
@dnum=grep(/^$i$/,@tmp);
$value=$#dnum+1;
if ($i==0){
for($y=$yyy-1900;$y<=$yyy2-1900;$y++){
for($m=1;$m<=12;$m++){
if (($m =~ /^[13578]$/) || ($m =~ /^1[02]$/)){
$finday = 31;
} elsif (($m =~ /^[469]$/) || ($m == 11)){
$finday = 30;
} elsif ($m == 2){
$finday = 28;
}
for($d=1;$d<=$finday;$d++){
$curline=timelocal(0,0,0,$d,$m-1,$y,$timetmp[6],$timetmp[7],$timetmp[8]);
if (($curline < $firstline)||($curline > $endline)){next;}
if ($count{"${y}_${m}_${d}"} eq ""){
$value++;
}
if ($date eq "${y}_${m}_${d}"){last;}
}
if ($date eq "${y}_${m}_${d}"){last;}
}
if ($date eq "${y}_${m}_${d}"){last;}
}
$gtotal=$value;
}
$linemax=2000;
printf("%02d件 | ",$i);
$width=($value/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$value;$j=$j+5){
# print "*";
# }
$num2 = $num2+$value*$i;
$mean1=($value/($total+$gtotal))*100;
print " $value日";
printf(" (%3.2f%%)
",$mean1);
}
$total=$total+$gtotal;
$mean=($total/($num2))*24;
print "---------------------
";
print "トータル=$total日、$num2件、 投稿平均間隔=";
printf("%3.2f",$mean);
print "時間
";
}
if ($in{choise} eq data13){
if (($in{new} eq on)&&($in{past} eq on)){
$inc=5;
} elsif ($in{new} eq on){
$inc=1;
} elsif ($in{past} eq on){
$inc=5;
}
print "$titleprint\n";
&subtitle;
print "
\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
if ($name eq $hname){
if ($today =~ /(\d\d)時\d\d分$/){
$count[$1]++;
$total++;
}
}
}
close(FILE);
@tmp = sort {$a <=> $b} @count;
$linemax=$tmp[$#tmp];
for($i=0;$i<=23;$i++){
printf("%02d時〜%02d時 | ",$i,$i+1);
if ($linemax == 0){last;}
$width=($count[$i]/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$count[$i];$j=$j+$inc){
# print "*";
# }
if ($total == 0){last;}
$pars=($count[$i]/$total)*100;
if ($count[$i] eq ""){$count[$i] = 0;}
print " $count[$i]";
printf(" (%2.2f%%)
\n",$pars);
}
print "---------------------
";
print "トータル=$total件
";
}
if ($in{choise} eq data14){
if (($in{new} eq on)&&($in{past} eq on)){
$inc=5;
} elsif ($in{new} eq on){
$inc=1;
} elsif ($in{past} eq on){
$inc=5;
}
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,$mail,$host,$today,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
if ($name eq $hname){
if ($today =~ /\((.*)\)\d\d時\d\d分$/){
$count{$1}++;
$total++;
}
}
}
close(FILE);
@tmp = sort {$a <=> $b} values(%count);
$linemax=$tmp[$#tmp];
foreach $week ('日','月','火','水','木','金','土'){
printf("%s | ",$week);
if ($linemax == 0){last;}
$width=($count{$week}/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$count{$week};$j=$j+$inc){
# print "*";
# }
if ($count{$week} eq ""){$count{$week}=0;}
if ($total == 0){last;}
$pars=($count{$week}/$total)*100;
print " $count{$week}\n";
printf(" (%2.2f%%)
\n",$pars);
}
print "---------------------
";
print "トータル = $total件
\n";
}
if ($in{choise} eq data15){
$inc=2;
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
$date =~ s/^(\d?\d\d_\d?\d)_\d?\d$/$1/;
$count{$date}++;
$total++;
if ($name eq $hname){
$personal{$date}++;
$ptotal++;
}
}
close(FILE);
@item=keys(%count);
@item1=();
foreach (@item){
s/^(\d?\d\d)_(\d)$/${1}0$2/;
s/^(\d?\d\d)_(\d\d)$/$1$2/;
push(@item1,$_);
}
@item1=sort {$a <=> $b} @item1;
$flag = 0;
@tmp = sort {$a <=> $b} values(%personal);
$linemax=$tmp[$#tmp];
foreach $date (@item1){
$date =~ s/^(\d?\d\d)([1-9]\d)$/${1}_$2/;
$date =~ s/^(\d?\d\d)0(\d)$/${1}_$2/;
($yy,$mm)=($1,$2);
if ($personal{$date} == 0 && $flag == 0){next;}
printf("%04d年%02d月 | ",$yy+1900,$mm);
if ($linemax == 0){last;}
$width=($personal{$date}/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
# for($j=0;$j<$personal{$date};$j=$j+$inc){
# print "*";
# }
if ($count{$date} != 0){
$pers=($personal{$date}/$count{$date})*100;
} else {
$pers=0;
}
if ($personal{$date} eq ""){$personal{$date}=0;}
print " $personal{$date}";
printf(" (%3.2f%%)
\n",$pers);
# if ($personal{$date} == 0 && $flag == 0){next;}
$flag = 1;
$item3++;
$p2total = $p2total + $count{$date};
}
# $mean1=$total/($#item+1);
if ($total != 0){$pers2=($ptotal/$total)*100;}
if ($p2total != 0){$pers1=($ptotal/$p2total)*100;}
if ($item3 != 0){$mean2=$ptotal/$item3;}
print "---------------------
";
print "トータル=$ptotal件、 初書き込み以来月平均=";
printf("%3.2f",$mean2);
print "件、
";
print "初書き込み以来全体の";
printf("%3.2f%%、",$pers1);
print "全書き込みの";
printf("%3.2f%%",$pers2);
print "\n";
}
if ($in{choise} eq data15a){
$inc=2;
print "$titleprint\n";
&subtitle;
print "\n";
print "「$in{hname}」での集計\n";
open(FILE,"< $filename");
while (){
chop;
($num,$date,$name,@line)=split(/,/);
if ($in{perso} eq "nokeep"){
$name=&checkname($name);
$hname=&checkname($in{hname});
} else {
$hname=$in{hname};
}
$date =~ s/^(\d?\d\d)_\d?\d_\d?\d$/$1/;
$count{$date}++;
$total++;
if ($name eq $hname){
$personal{$date}++;
$ptotal++;
}
}
close(FILE);
@item=keys(%count);
@item1=@item;
# @item1=();
# foreach (@item){
# s/^(\d?\d\d)_(\d)$/${1}0$2/;
# s/^(\d?\d\d)_(\d\d)$/$1$2/;
# push(@item1,$_);
# }
@item1=sort {$a <=> $b} @item1;
$flag = 0;
@tmp = sort {$a <=> $b} values(%personal);
$linemax=$tmp[$#tmp];
foreach $date (@item1){
# $date =~ s/(\d?\d\d)([1-9]\d)/${1}_$2/;
# $date =~ s/(\d?\d\d)0(\d)/${1}_$2/;
$yy=$date;
if ($personal{$date} == 0 && $flag == 0){next;}
printf("%04d年 | ",$yy+1900);
if ($linemax == 0){last;}
$width=($personal{$date}/$linemax)*$rightend;
if ($width != 0){
print "
\n";
}
$pers=($personal{$date}/$count{$date})*100;
if ($personal{$date} eq ""){$personal{$date}=0;}
print " $personal{$date}";
printf(" (%3.2f%%)
\n",$pers);
# if ($personal{$date} == 0 && $flag == 0){next;}
$flag = 1;
$item3++;
$p2total = $p2total + $count{$date};
}
# $mean1=$total/($#item+1);
if ($item3 != 0){$mean2=$ptotal/$item3;}
if ($p2total != 0){$pers1=($ptotal/$p2total)*100;}
if ($total != 0){$pers2=($ptotal/$total)*100;}
print "---------------------
";
print "トータル=$ptotal件、 初書き込み以来年平均=";
printf("%3.2f",$mean2);
print "件、
";
print "初書き込み以来全体の";
printf("%3.2f%%、",$pers1);
print "全書き込みの";
printf("%3.2f%%",$pers2);
print "\n";
}
print "\n";
print "";
if ($in{ref} eq 'part' || $in{ref} eq 'timeframe' || $compatible == 1){
unlink("$tmpdata");
}
exit;
sub subtitle {
if ($in{ref} eq 'part'){
print "Message#$in{startnum}から$in{endnum}まで\n";
} elsif ($in{ref} eq 'timeframe'){
$fullsty=$in{styear}+1900;
$fulledy=$in{endyear}+1900;
print "$fullsty年$in{stmon}月$in{stday}日から$fulledy年$in{endmon}月$in{endday}日まで
\n";
}
}
}
sub gentmpdata {
local($filename,$tmpdata);
$tmpdata = "$mbdir/tmp.$$";
if ($compatible == 1) {
`$cat $mbarchdata $mbpastdata $mbdata > $alldata`;
chmod(0666,"$alldata");
$filename="$alldata";
} else {
$filename = $mbdata;
}
if (($in{m1} =~ /^[13578]$/) || ($in{m1} =~ /^1[02]$/)){
$finday = 31;
} elsif (($in{m1} =~ /^[469]$/) || ($in{m1} == 11)){
$finday = 30;
} elsif ($in{m1} == 2){
$finday = 28;
}
if ($in{ref} eq 'part'){
open(ALLFILE,"< $filename");
open(TMPFILE,"> $tmpdata");
while(){
($num,@dum)=split(/,/);
if ($num >= $in{startnum} && $num <= $in{endnum}){
print TMPFILE;
}
if ($num > $in{endnum}){last;}
}
close(ALLFILE);
close(TMPFILE);
$filename=$tmpdata;
} elsif ($in{ref} eq 'timeframe'){
open(ALLFILE,"< $filename");
open(TMPFILE,"> $tmpdata");
@timetmp=gmtime($time_offset);
$firstline=timelocal(0,0,0,$in{stday},$in{stmon}-1,$in{styear},$timetmp[6],$timetmp[7],$timetmp[8]);
$endline=timelocal(0,0,0,$in{endday},$in{endmon}-1,$in{endyear},$timetmp[6],$timetmp[7],$timetmp[8]);
while(){
($num,$datecode,@dum)=split(/,/);
($cury,$curm,$curd)=split(/_/,$datecode);
$curline=timelocal(0,0,0,$curd,$curm-1,$cury,$timetmp[6],$timetmp[7],$timetmp[8]);
if (($curline >= $firstline)&&($curline <= $endline)){
print TMPFILE;
}
if ($curline > $endline){last;}
}
close(ALLFILE);
close(TMPFILE);
$filename=$tmpdata;
}
return ($filename,$tmpdata);
}
# 統計の個人名方式で「人物」を選んだ場合に違う名前を同一人物と
# 判断させることができます。
# namedef.datにそれらの名前を人物ごとに1行に登録されていると
# 一番左の名前が代表として表示されます。
# 例:以下はnamedef.datの内容の例です。
# ----------------------------------------
# 管理人,作成者,かんりにん
# ホークス,hawks
# ----------------------------------------
# この例では、「作成者」「かんりにん」共に「管理人」と同一人物として
# まとめて集計されます。
# 「ホークス」は改行されているので管理人と別人として判断されますが、
# 「hawks」とは同一人物となります。
# namedef.datがない場合は、書き込みの名前そのままで集計されます。
sub checkname {
local($name)=@_;
open(NAMES,"< $namedef") || return($name);
while(){
s/[\r\n]*$//; # instead of chop;
(@nicknames)=split(/,/);
foreach $nick (@nicknames){
if ("$name" eq "$nick"){
close(NAMES);
return($nicknames[0]);
}
}
}
close(NAMES);
return($name);
}
#############################################################################
# Search Form mode ##########################################################
#############################################################################
sub mbschform {
&getmbdata;
($num,$datecode,@dum)=split(/,/,$alldata[$#alldata]);
$datecode =~ /^(\d\d+)_\d+_\d+/;
$finyear = $1;
if ($compatible == 0){
open(FILE,"< $mbdata");
$firstdata = ;
close(FILE);
} else {
open(FILE,"< $mbarchdata") || open(FILE,"< $mbpastdata") || open(FILE,"< $mbdata");
$firstdata = ;
close(FILE);
}
($num,$datecode,@dum)=split(/,/,$firstdata);
$datecode =~ /^(\d\d+)_/;
$firstyear = $1;
print "Content-Type:text/html\n\n";
print <
$mbsrctitle
END
if ($head_insert_en == 1){
print "$head_insert\n";
}
if ($style_sheet_en == 1){
print "\n";
}
$titleprint=&titleprint("$mbsrctitle","$mbsrc_logo","$mbsrc_style","$mbsrc_color","$mbsrc_size","$mbsrc_face","$mbsrc_sel","$mbsrc_loc");
print <